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, "Bhumika Goyal" <bhumirks@gmail.com>,
	"Frank Schäfer" <fschaefer.oss@googlemail.com>,
	"Guennadi Liakhovetski" <g.liakhovetski@gmx.de>,
	"Hans Verkuil" <hans.verkuil@cisco.com>,
	"Janusz Krzysztofik" <jmkrzyszt@gmail.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 5/7] [media] ov9640: Improve a size determination in ov9640_probe()
Date: Sat, 2 Sep 2017 17:52:05 +0200	[thread overview]
Message-ID: <5d342b6f-8283-c1ce-5469-fefeffcc05d4@users.sourceforge.net> (raw)
In-Reply-To: <c9f2ba21-c742-e1e8-26d9-a56c51c56d65@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 2 Sep 2017 16:37:03 +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/soc_camera/ov9640.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/soc_camera/ov9640.c b/drivers/media/i2c/soc_camera/ov9640.c
index 0f02f022f3e9..67578f194928 100644
--- a/drivers/media/i2c/soc_camera/ov9640.c
+++ b/drivers/media/i2c/soc_camera/ov9640.c
@@ -675,5 +675,5 @@ static int ov9640_probe(struct i2c_client *client,
 		return -EINVAL;
 	}
 
-	priv = devm_kzalloc(&client->dev, sizeof(struct ov9640_priv), GFP_KERNEL);
+	priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
-- 
2.14.1

  parent reply	other threads:[~2017-09-02 15:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-02 15:47 [PATCH 0/7] [media] OmniVision: Adjustments for four function implementations SF Markus Elfring
2017-09-02 15:48 ` [PATCH 1/7] [media] ov2640: Delete an error message for a failed memory allocation in ov2640_probe() SF Markus Elfring
2017-09-02 15:49 ` [PATCH 2/7] [media] ov2640: Improve a size determination " SF Markus Elfring
2017-09-02 15:50 ` [PATCH 3/7] [media] ov6650: Delete an error message for a failed memory allocation in ov6650_probe() SF Markus Elfring
2017-09-02 15:51 ` [PATCH 4/7] [media] ov9640: Delete an error message for a failed memory allocation in ov9640_probe() SF Markus Elfring
2017-09-02 15:52 ` SF Markus Elfring [this message]
2017-09-02 15:53 ` [PATCH 6/7] [media] ov9740: Delete an error message for a failed memory allocation in ov9740_probe() SF Markus Elfring
2017-09-02 15:54 ` [PATCH 7/7] [media] ov9740: Improve a size determination " 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=5d342b6f-8283-c1ce-5469-fefeffcc05d4@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=bhumirks@gmail.com \
    --cc=fschaefer.oss@googlemail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=jmkrzyszt@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.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