From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 6/7] [media] Mantis: Improve a size determination in mantis_pci_probe()
Date: Sat, 2 Sep 2017 22:46:11 +0200 [thread overview]
Message-ID: <f50ebe4b-a614-3a78-892b-10ce2f0342e1@users.sourceforge.net> (raw)
In-Reply-To: <9ba22d42-0ec0-b865-dec5-4ce67ad443fb@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 2 Sep 2017 21:56:07 +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.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/pci/mantis/mantis_cards.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c
index 56a01f6f84c7..6182ae44dd23 100644
--- a/drivers/media/pci/mantis/mantis_cards.c
+++ b/drivers/media/pci/mantis/mantis_cards.c
@@ -173,5 +173,5 @@ static int mantis_pci_probe(struct pci_dev *pdev,
struct mantis_hwconfig *config;
int err = 0;
- mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL);
+ mantis = kzalloc(sizeof(*mantis), GFP_KERNEL);
if (!mantis)
--
2.14.1
next prev parent reply other threads:[~2017-09-02 20:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-02 20:40 [PATCH 0/7] [media] Mantis: Adjustments for three function implementations SF Markus Elfring
2017-09-02 20:41 ` [PATCH 1/7] [media] Hopper: Delete an error message for a failed memory allocation in hopper_pci_probe() SF Markus Elfring
2017-09-02 20:42 ` [PATCH 2/7] [media] Hopper: Improve a size determination " SF Markus Elfring
2017-09-02 20:43 ` [PATCH 3/7] [media] Hopper: Adjust a null pointer check in two functions SF Markus Elfring
2017-09-02 20:44 ` [PATCH 4/7] [media] Hopper: Delete an unnecessary variable initialisation in hopper_pci_probe() SF Markus Elfring
2017-09-02 20:45 ` [PATCH 5/7] [media] Mantis: Delete an error message for a failed memory allocation in mantis_pci_probe() SF Markus Elfring
2017-09-02 20:46 ` SF Markus Elfring [this message]
2017-09-02 20:47 ` [PATCH 7/7] [media] Mantis: Delete an unnecessary variable initialisation " 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=f50ebe4b-a614-3a78-892b-10ce2f0342e1@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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