From: SF Markus Elfring <elfring@users.sourceforge.net>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
kernel-janitors@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/6] PNP: Improve a size determination in pnp_alloc_dev()
Date: Mon, 15 May 2017 21:14:08 +0200 [thread overview]
Message-ID: <85dba381-3e7d-7df1-9fac-458fe625d2f5@users.sourceforge.net> (raw)
In-Reply-To: <94f6ec12-0092-e1e6-3fb1-81f9630eae1f@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 15 May 2017 19:45:23 +0200
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pnp/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 27945a2d9c4e..6ccec10aed11 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -141,7 +141,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id,
struct pnp_dev *dev;
struct pnp_id *dev_id;
- dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL);
+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;
--
2.13.0
next prev parent reply other threads:[~2017-05-15 19:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 19:10 [PATCH 0/6] PNP: Adjustments for four function implementations SF Markus Elfring
2017-05-15 19:12 ` [PATCH 1/6] PNP: Delete an error message for a failed memory allocation in pnp_alloc() SF Markus Elfring
2017-05-15 19:14 ` SF Markus Elfring [this message]
2017-05-15 19:16 ` [PATCH 3/6] PNP: Improve a size determination in pnp_clone_dependent_set() SF Markus Elfring
2017-05-15 19:18 ` [PATCH 4/6] PNP: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-05-15 19:20 ` [PATCH 5/6] PNP: Improve a size determination in quirk_awe32_add_ports() SF Markus Elfring
2017-05-15 19:22 ` [PATCH 6/6] PNP: Delete an error message for a failed memory allocation " SF Markus Elfring
2017-05-27 19:08 ` [PATCH 0/6] PNP: Adjustments for four function implementations Andy Shevchenko
2017-12-18 18:21 ` 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=85dba381-3e7d-7df1-9fac-458fe625d2f5@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.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
Powered by JetHome