From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-pcmcia@lists.infradead.org,
Bhumika Goyal <bhumirks@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] pcmcia/cis: Improve a size determination in pcmcia_loop_config()
Date: Thu, 28 Dec 2017 22:48:17 +0100 [thread overview]
Message-ID: <5c488128-16ca-195c-f5fc-ab97938bd8e5@users.sourceforge.net> (raw)
In-Reply-To: <4eaa454f-8b57-fe0a-4802-3676bc2f582e@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 28 Dec 2017 22:30:42 +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/pcmcia/pcmcia_cis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pcmcia/pcmcia_cis.c b/drivers/pcmcia/pcmcia_cis.c
index ffcd014b7bc1..ecee94e8f30a 100644
--- a/drivers/pcmcia/pcmcia_cis.c
+++ b/drivers/pcmcia/pcmcia_cis.c
@@ -264,7 +264,7 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev,
struct pcmcia_cfg_mem *cfg_mem;
int ret;
- cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
+ cfg_mem = kzalloc(sizeof(*cfg_mem), GFP_KERNEL);
if (cfg_mem == NULL)
return -ENOMEM;
--
2.15.1
prev parent reply other threads:[~2017-12-28 21:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-28 21:44 [PATCH 0/3] PCMCIA-CIS: Adjustments for six function implementations SF Markus Elfring
2017-12-28 21:45 ` [PATCH 1/3] pcmcia/cistpl: Delete error messages for a failed memory allocation in three functions SF Markus Elfring
2017-12-28 21:46 ` [PATCH 2/3] pcmcia/cis: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-12-28 21:48 ` SF Markus Elfring [this message]
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=5c488128-16ca-195c-f5fc-ab97938bd8e5@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=bhumirks@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pcmcia@lists.infradead.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®