From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/4] ASoC: wm2000: Improve a size determination in wm2000_i2c_probe()
Date: Fri, 24 Nov 2017 08:40:22 +0100 [thread overview]
Message-ID: <a6e50094-3d1c-6ad4-67e4-377036f5ccd6@users.sourceforge.net> (raw)
In-Reply-To: <cd76c876-81a5-3cf6-e7d9-52037729fb98@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 24 Nov 2017 08:18:14 +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>
---
sound/soc/codecs/wm2000.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 2151e75ee5c6..86e7f9ebab44 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -826,8 +826,7 @@ static int wm2000_i2c_probe(struct i2c_client *i2c,
int reg;
u16 id;
- wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv),
- GFP_KERNEL);
+ wm2000 = devm_kzalloc(&i2c->dev, sizeof(*wm2000), GFP_KERNEL);
if (!wm2000)
return -ENOMEM;
--
2.15.0
next prev parent reply other threads:[~2017-11-24 7:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 7:34 [PATCH 0/4] ASoC: wm2000: Adjustments for wm2000_i2c_probe() SF Markus Elfring
2017-11-24 7:36 ` [PATCH 1/4] ASoC: wm2000: Delete an error message for a failed memory allocation in wm2000_i2c_probe() SF Markus Elfring
2017-11-24 8:11 ` Charles Keepax
2017-11-27 18:54 ` Applied "ASoC: wm2000: Delete an error message for a failed memory allocation in wm2000_i2c_probe()" to the asoc tree Mark Brown
2017-11-24 7:37 ` [PATCH 2/4] ASoC: wm2000: One function call less in wm2000_i2c_probe() after error detection SF Markus Elfring
2017-11-24 8:34 ` Charles Keepax
2017-11-24 7:39 ` [PATCH 3/4] ASoC: wm2000: Fix a typo in a comment line SF Markus Elfring
2017-11-24 8:34 ` Charles Keepax
2017-11-27 18:54 ` Applied "ASoC: wm2000: Fix a typo in a comment line" to the asoc tree Mark Brown
2017-11-24 7:40 ` SF Markus Elfring [this message]
2017-11-24 8:34 ` [PATCH 4/4] ASoC: wm2000: Improve a size determination in wm2000_i2c_probe() Charles Keepax
2017-11-27 18:54 ` Applied "ASoC: wm2000: Improve a size determination in wm2000_i2c_probe()" to the asoc tree Mark Brown
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=a6e50094-3d1c-6ad4-67e4-377036f5ccd6@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).