mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 4/4] [media] adv7842: Improve a size determination in adv7842_probe()
Date: Sat, 2 Sep 2017 15:10:13 +0200	[thread overview]
Message-ID: <0ffbe17f-7de1-a456-a066-227f25642fa1@users.sourceforge.net> (raw)
In-Reply-To: <0e67e095-4931-b78f-a925-7335326ab69c@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 2 Sep 2017 12:53:15 +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/i2c/adv7842.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 366a294edd7b..aa8b3bcdd750 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -3467,5 +3467,5 @@ static int adv7842_probe(struct i2c_client *client,
 		return -ENODEV;
 	}
 
-	state = devm_kzalloc(&client->dev, sizeof(struct adv7842_state), GFP_KERNEL);
+	state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
 	if (!state)
-- 
2.14.1

      parent reply	other threads:[~2017-09-02 13:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-02 13:04 [PATCH 0/4] [media] ADV7...: Adjustments for four function implementations SF Markus Elfring
2017-09-02 13:06 ` [PATCH 1/4] [media] adv7604: Delete an error message for a failed memory allocation in adv76xx_probe() SF Markus Elfring
2017-09-02 13:07 ` [PATCH 2/4] [media] adv7604: Adjust a null pointer check in three functions SF Markus Elfring
2017-09-02 13:08 ` [PATCH 3/4] [media] adv7842: Delete an error message for a failed memory allocation in adv7842_probe() SF Markus Elfring
2017-09-02 13:10 ` 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=0ffbe17f-7de1-a456-a066-227f25642fa1@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=hans.verkuil@cisco.com \
    --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

Powered by JetHome