From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>, Brent Casavant <bcasavan@sgi.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jeremy Higdon <jeremy@sgi.com>, Pat Gefre <pfg@sgi.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] misc/ioc4: Improve a size determination in ioc4_probe()
Date: Mon, 8 Jan 2018 17:17:54 +0100 [thread overview]
Message-ID: <85565afd-5995-83d3-0e7e-3441eeb298c3@users.sourceforge.net> (raw)
In-Reply-To: <4fb26753-2ae3-7c17-7777-03c6923a1d4b@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 Jan 2018 16:18:52 +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/ioc4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
index 5bd422498fff..704e13382df0 100644
--- a/drivers/misc/ioc4.c
+++ b/drivers/misc/ioc4.c
@@ -295,7 +295,7 @@ ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
pci_set_master(pdev);
/* Set up per-IOC4 data */
- idd = kmalloc(sizeof(struct ioc4_driver_data), GFP_KERNEL);
+ idd = kmalloc(sizeof(*idd), GFP_KERNEL);
if (!idd) {
ret = -ENOMEM;
goto out_idd;
--
2.15.1
next prev parent reply other threads:[~2018-01-08 16:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 16:10 [PATCH 0/4] misc-IOC4: Adjustments for ioc4_probe() SF Markus Elfring
2018-01-08 16:15 ` [PATCH 1/4] misc/ioc4: Return -ENOMEM after a failed kmalloc() in ioc4_probe() SF Markus Elfring
2018-01-08 16:16 ` [PATCH 2/4] misc/ioc4: Delete an error message for a failed memory allocation " SF Markus Elfring
2018-01-08 16:17 ` SF Markus Elfring [this message]
2018-01-08 16:19 ` [PATCH 4/4] misc/ioc4: Adjust one function call together with a variable assignment 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=85565afd-5995-83d3-0e7e-3441eeb298c3@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bcasavan@sgi.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeremy@sgi.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pfg@sgi.com \
/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®