Patchwork mtd: plat-ram: Remove casting the return value which is a void pointer

login
register
mail settings
Submitter Jingoo Han
Date Sept. 9, 2013, 5:42 a.m.
Message ID <005801cead1f$6d0af870$4720e950$%han@samsung.com>
Download mbox | patch
Permalink /patch/273490/
State New
Headers show

Comments

Jingoo Han - Sept. 9, 2013, 5:42 a.m.
Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/mtd/maps/plat-ram.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Brian Norris - Oct. 2, 2013, 6:03 p.m.
On Mon, Sep 09, 2013 at 02:42:52PM +0900, Jingoo Han wrote:
> Casting the return value which is a void pointer is redundant.
> The conversion from void pointer to any other pointer type is
> guaranteed by the C programming language.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/mtd/maps/plat-ram.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
> index 6762716..3e35b9a 100644
> --- a/drivers/mtd/maps/plat-ram.c
> +++ b/drivers/mtd/maps/plat-ram.c
> @@ -55,7 +55,7 @@ struct platram_info {
>  
>  static inline struct platram_info *to_platram_info(struct platform_device *dev)
>  {
> -	return (struct platram_info *)platform_get_drvdata(dev);
> +	return platform_get_drvdata(dev);
>  }
>  
>  /* platram_setrw

Pushed to l2-mtd.git. Thanks!

Brian

Patch

diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 6762716..3e35b9a 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -55,7 +55,7 @@  struct platram_info {
 
 static inline struct platram_info *to_platram_info(struct platform_device *dev)
 {
-	return (struct platram_info *)platform_get_drvdata(dev);
+	return platform_get_drvdata(dev);
 }
 
 /* platram_setrw