From: Markus Elfring <elfr...@users.sourceforge.net>
Date: Thu, 23 Nov 2017 21:45:55 +0100

Replace the specification of data structures by pointer dereferences
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 <elfr...@users.sourceforge.net>
---
 sound/soc/codecs/twl4030.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index a1f0b45c83ca..946818a0412c 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -236,9 +236,7 @@ static struct twl4030_codec_data *twl4030_get_pdata(struct 
snd_soc_codec *codec)
                                                  "codec");
 
        if (!pdata && twl4030_codec_node) {
-               pdata = devm_kzalloc(codec->dev,
-                                    sizeof(struct twl4030_codec_data),
-                                    GFP_KERNEL);
+               pdata = devm_kzalloc(codec->dev, sizeof(*pdata), GFP_KERNEL);
                if (!pdata)
                        goto put_node;
 
@@ -2168,8 +2166,7 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
 {
        struct twl4030_priv *twl4030;
 
-       twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
-                              GFP_KERNEL);
+       twl4030 = devm_kzalloc(codec->dev, sizeof(*twl4030), GFP_KERNEL);
        if (!twl4030)
                return -ENOMEM;
        snd_soc_codec_set_drvdata(codec, twl4030);
-- 
2.15.0

Reply via email to