All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] drivers/ifc:Typecast argument to kfree
@ 2015-05-20  9:17 Raghav Dogra
  2015-05-22 20:28 ` [U-Boot] " Scott Wood
  0 siblings, 1 reply; 2+ messages in thread
From: Raghav Dogra @ 2015-05-20  9:17 UTC (permalink / raw)
  To: u-boot

kfree accepts the argument having type void *
Typecasting priv to match it

Signed-off-by: Raghav Dogra <raghav@freescale.com>
---
 drivers/mtd/nand/fsl_ifc_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 79fa88b..7ddc7e8 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -909,7 +909,7 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
 	if (priv->bank >= MAX_BANKS) {
 		printf("%s: address did not match any "
 		       "chip selects\n", __func__);
-		kfree(priv);
+		kfree((void *)priv);
 		return -ENODEV;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] drivers/ifc:Typecast argument to kfree
  2015-05-20  9:17 [U-Boot] [PATCH] drivers/ifc:Typecast argument to kfree Raghav Dogra
@ 2015-05-22 20:28 ` Scott Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Scott Wood @ 2015-05-22 20:28 UTC (permalink / raw)
  To: u-boot

On Wed, May 20, 2015 at 02:47:15PM +0530, Raghav Dogra wrote:
> kfree accepts the argument having type void *
> Typecasting priv to match it
> 
> Signed-off-by: Raghav Dogra <raghav@freescale.com>
> ---
>  drivers/mtd/nand/fsl_ifc_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index 79fa88b..7ddc7e8 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -909,7 +909,7 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
>  	if (priv->bank >= MAX_BANKS) {
>  		printf("%s: address did not match any "
>  		       "chip selects\n", __func__);
> -		kfree(priv);
> +		kfree((void *)priv);
>  		return -ENODEV;
>  	}

There is no need to do this.  Unnecessary casts harm legibility and
reduce safety.

-Scott

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-22 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20  9:17 [U-Boot] [PATCH] drivers/ifc:Typecast argument to kfree Raghav Dogra
2015-05-22 20:28 ` [U-Boot] " Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.