From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Arvind Yadav <arvind.yadav.cs@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Johannes Berg <johannes.berg@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] misc/ti-st: Improve a size determination in kim_probe()
Date: Wed, 10 Jan 2018 16:33:23 +0100 [thread overview]
Message-ID: <5df1dcbb-2c86-f333-0b1f-4ad3b86a3278@users.sourceforge.net> (raw)
In-Reply-To: <b038e780-8cd2-a550-108c-2f8a35f3571e@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Jan 2018 16:10:45 +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/misc/ti-st/st_kim.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 68ebdf466b17..948e3461d02e 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -735,7 +735,7 @@ static int kim_probe(struct platform_device *pdev)
st_kim_devices[0] = pdev;
}
- kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);
+ kim_gdata = kzalloc(sizeof(*kim_gdata), GFP_ATOMIC);
if (!kim_gdata)
return -ENOMEM;
--
2.15.1
next prev parent reply other threads:[~2018-01-10 15:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 15:30 [PATCH 0/3] misc/TI-ST: Adjustments for three function implementations SF Markus Elfring
2018-01-10 15:32 ` [PATCH 1/3] misc/ti-st: Delete an error message for a failed memory allocation in kim_probe() SF Markus Elfring
2018-01-10 15:33 ` SF Markus Elfring [this message]
2018-01-10 15:34 ` [PATCH 3/3] misc/ti-st: Delete an unnecessary return statement in two functions 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=5df1dcbb-2c86-f333-0b1f-4ad3b86a3278@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arnd@arndb.de \
--cc=arvind.yadav.cs@gmail.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=johannes.berg@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stephen@networkplumber.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®