lkml.org 
[lkml]   [2018]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/3] irq-imx-gpcv2: Improve a size determination in imx_gpcv2_irqchip_init()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 18 Jan 2018 21:25:13 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/irqchip/irq-imx-gpcv2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c
index f08fcbb46b1b..e62f22c84112 100644
--- a/drivers/irqchip/irq-imx-gpcv2.c
+++ b/drivers/irqchip/irq-imx-gpcv2.c
@@ -224,7 +224,7 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node,
return -ENXIO;
}

- cd = kzalloc(sizeof(struct gpcv2_irqchip_data), GFP_KERNEL);
+ cd = kzalloc(sizeof(*cd), GFP_KERNEL);
if (!cd)
return -ENOMEM;

--
2.15.1
\
 
 \ /
  Last update: 2018-01-18 22:16    [W:0.038 / U:4.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site