From: Markus Elfring <Markus.Elfring@web.de>
To: linux-sound@vger.kernel.org,
Daniel Beer <daniel.beer@igorinstitute.com>,
Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH 2/2] ASoC: tas5805m: Improve a size determination in tas5805m_i2c_probe()
Date: Mon, 16 Sep 2024 10:50:26 +0200 [thread overview]
Message-ID: <6a6c87d3-9e4f-4980-ae06-b0d5e16dd0c0@web.de> (raw)
In-Reply-To: <a7ce512c-0f82-47f6-89fb-f7269e4fdfae@web.de>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Sep 2024 10:20:12 +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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/soc/codecs/tas5805m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas5805m.c b/sound/soc/codecs/tas5805m.c
index f37eec960364..d4f028451071 100644
--- a/sound/soc/codecs/tas5805m.c
+++ b/sound/soc/codecs/tas5805m.c
@@ -473,7 +473,7 @@ static int tas5805m_i2c_probe(struct i2c_client *i2c)
return ret;
}
- tas5805m = devm_kzalloc(dev, sizeof(struct tas5805m_priv), GFP_KERNEL);
+ tas5805m = devm_kzalloc(dev, sizeof(*tas5805m), GFP_KERNEL);
if (!tas5805m)
return -ENOMEM;
--
2.46.0
next prev parent reply other threads:[~2024-09-16 8:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 8:38 [PATCH 0/2] ASoC: tas5805m: Adjustments for tas5805m_i2c_probe() Markus Elfring
2024-09-16 8:48 ` [PATCH 1/2] ASoC: tas5805m: Use scope-based resource management in tas5805m_i2c_probe() Markus Elfring
2024-09-16 8:50 ` Markus Elfring [this message]
2024-09-30 21:26 ` (subset) [PATCH 0/2] ASoC: tas5805m: Adjustments for tas5805m_i2c_probe() 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=6a6c87d3-9e4f-4980-ae06-b0d5e16dd0c0@web.de \
--to=markus.elfring@web.de \
--cc=broonie@kernel.org \
--cc=daniel.beer@igorinstitute.com \
--cc=dmitry.torokhov@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--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