[PATCH] drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup

2013-04-02 Thread Patrik Jakobsson
On Mon, Mar 11, 2013 at 8:46 PM, Alexandru Gheorghiu
 wrote:
> Replaced calls kzalloc followed by memcpy with call to kmemdup.
> Patch found using coccinelle.
>
> Signed-off-by: Alexandru Gheorghiu 
> ---
>  drivers/gpu/drm/gma500/intel_bios.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/intel_bios.c 
> b/drivers/gpu/drm/gma500/intel_bios.c
> index 403fffb..d349734 100644
> --- a/drivers/gpu/drm/gma500/intel_bios.c
> +++ b/drivers/gpu/drm/gma500/intel_bios.c
> @@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private 
> *dev_priv,
> bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
> vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;
>
> -   lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
> +   lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
> if (!lvds_bl) {
> dev_err(dev_priv->dev->dev, "out of memory for backlight 
> data\n");
> return;
> }
> -   memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
> dev_priv->lvds_bl = lvds_bl;
>  }
>
> --
> 1.7.9.5
>
> --

Your patch has been applied to:
https://github.com/patjak/drm-gma500.git gma500-next

Thanks
Patrik Jakobsson


Re: [PATCH] drivers: gpu: drm: gma500: Replaced calls kzalloc memcpy with kmemdup

2013-04-02 Thread Patrik Jakobsson
On Mon, Mar 11, 2013 at 8:46 PM, Alexandru Gheorghiu
gheorghiuan...@gmail.com wrote:
 Replaced calls kzalloc followed by memcpy with call to kmemdup.
 Patch found using coccinelle.

 Signed-off-by: Alexandru Gheorghiu gheorghiuan...@gmail.com
 ---
  drivers/gpu/drm/gma500/intel_bios.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/gma500/intel_bios.c 
 b/drivers/gpu/drm/gma500/intel_bios.c
 index 403fffb..d349734 100644
 --- a/drivers/gpu/drm/gma500/intel_bios.c
 +++ b/drivers/gpu/drm/gma500/intel_bios.c
 @@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private 
 *dev_priv,
 bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
 vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;

 -   lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
 +   lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
 if (!lvds_bl) {
 dev_err(dev_priv-dev-dev, out of memory for backlight 
 data\n);
 return;
 }
 -   memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
 dev_priv-lvds_bl = lvds_bl;
  }

 --
 1.7.9.5

 --

Your patch has been applied to:
https://github.com/patjak/drm-gma500.git gma500-next

Thanks
Patrik Jakobsson
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup

2013-03-11 Thread Patrik Jakobsson
On Mon, Mar 11, 2013 at 8:46 PM, Alexandru Gheorghiu
 wrote:
> Replaced calls kzalloc followed by memcpy with call to kmemdup.
> Patch found using coccinelle.
>
> Signed-off-by: Alexandru Gheorghiu 
> ---
>  drivers/gpu/drm/gma500/intel_bios.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/intel_bios.c 
> b/drivers/gpu/drm/gma500/intel_bios.c
> index 403fffb..d349734 100644
> --- a/drivers/gpu/drm/gma500/intel_bios.c
> +++ b/drivers/gpu/drm/gma500/intel_bios.c
> @@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private 
> *dev_priv,
> bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
> vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;
>
> -   lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
> +   lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
> if (!lvds_bl) {
> dev_err(dev_priv->dev->dev, "out of memory for backlight 
> data\n");
> return;
> }
> -   memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
> dev_priv->lvds_bl = lvds_bl;
>  }
>
> --
> 1.7.9.5

Reviewed-by: Patrik Jakobsson 


[PATCH] drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup

2013-03-11 Thread Alexandru Gheorghiu
Replaced calls kzalloc followed by memcpy with call to kmemdup.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu 
---
 drivers/gpu/drm/gma500/intel_bios.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gma500/intel_bios.c 
b/drivers/gpu/drm/gma500/intel_bios.c
index 403fffb..d349734 100644
--- a/drivers/gpu/drm/gma500/intel_bios.c
+++ b/drivers/gpu/drm/gma500/intel_bios.c
@@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private 
*dev_priv,
bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;

-   lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
+   lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
if (!lvds_bl) {
dev_err(dev_priv->dev->dev, "out of memory for backlight 
data\n");
return;
}
-   memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
dev_priv->lvds_bl = lvds_bl;
 }

-- 
1.7.9.5



[PATCH] drivers: gpu: drm: gma500: Replaced calls kzalloc memcpy with kmemdup

2013-03-11 Thread Alexandru Gheorghiu
Replaced calls kzalloc followed by memcpy with call to kmemdup.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu gheorghiuan...@gmail.com
---
 drivers/gpu/drm/gma500/intel_bios.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gma500/intel_bios.c 
b/drivers/gpu/drm/gma500/intel_bios.c
index 403fffb..d349734 100644
--- a/drivers/gpu/drm/gma500/intel_bios.c
+++ b/drivers/gpu/drm/gma500/intel_bios.c
@@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private 
*dev_priv,
bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;
 
-   lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
+   lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
if (!lvds_bl) {
dev_err(dev_priv-dev-dev, out of memory for backlight 
data\n);
return;
}
-   memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
dev_priv-lvds_bl = lvds_bl;
 }
 
-- 
1.7.9.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel