mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Kevin Hilman <khilman@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Santosh Shilimkar <ssantosh@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] gpio: omap: Improve a size determination in omap_gpio_probe()
Date: Sat, 10 Feb 2018 22:08:28 +0100	[thread overview]
Message-ID: <422a4c63-5ffc-2b40-4d9a-cf947d4af2fd@users.sourceforge.net> (raw)
In-Reply-To: <8ec31664-badc-5454-b759-ae9132833589@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Feb 2018 21:49:22 +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/gpio/gpio-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 4db6f13fa133..35971a341c40 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1157,7 +1157,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -EINVAL;
 
-	bank = devm_kzalloc(dev, sizeof(struct gpio_bank), GFP_KERNEL);
+	bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL);
 	if (!bank)
 		return -ENOMEM;
 
-- 
2.16.1

  parent reply	other threads:[~2018-02-10 21:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-10 21:05 [PATCH 0/2] GPIO-OMAP: Adjustments for omap_gpio_probe() SF Markus Elfring
2018-02-10 21:07 ` [PATCH 1/2] gpio: omap: Delete an error message for a failed memory allocation in omap_gpio_probe() SF Markus Elfring
2018-02-22 14:16   ` Linus Walleij
2018-02-10 21:08 ` SF Markus Elfring [this message]
2018-02-22 14:17   ` [PATCH 2/2] gpio: omap: Improve a size determination " Linus Walleij
2018-02-12 17:33 ` [PATCH 0/2] GPIO-OMAP: Adjustments for omap_gpio_probe() Grygorii Strashko

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=422a4c63-5ffc-2b40-4d9a-cf947d4af2fd@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=grygorii.strashko@ti.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khilman@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ssantosh@kernel.org \
    /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®