From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>,
Shenwei Wang <shenwei.wang@freescale.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] irq-imx-gpcv2: Improve a size determination in imx_gpcv2_irqchip_init()
Date: Thu, 18 Jan 2018 22:15:40 +0100 [thread overview]
Message-ID: <56c51505-0ac3-7c59-6ba3-768dd3a675da@users.sourceforge.net> (raw)
In-Reply-To: <e9033837-9e04-be5b-2875-aa746840d5a7@users.sourceforge.net>
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
next prev parent reply other threads:[~2018-01-18 21:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 21:13 [PATCH 0/3] irq-imx-gpcv2: Adjustments for imx_gpcv2_irqchip_init() SF Markus Elfring
2018-01-18 21:14 ` [PATCH 1/3] irq-imx-gpcv2: Delete an error message for a failed memory allocation in imx_gpcv2_irqchip_init() SF Markus Elfring
2018-01-18 21:15 ` SF Markus Elfring [this message]
2018-01-18 21:17 ` [PATCH 3/3] irq-imx-gpcv2: Use common error handling code " SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56c51505-0ac3-7c59-6ba3-768dd3a675da@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=jason@lakedaemon.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=shenwei.wang@freescale.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®