ASoC: rsnd: Delete an error message for a failed memory allocation in three functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 10 Aug 2017 15:13:19 +0000 (17:13 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 10 Aug 2017 15:32:38 +0000 (16:32 +0100)
Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/adg.c
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/gen.c

index 5b5389e5b92b3e5da3dbaa66bea9b6b5bbfce894..938baff86ef280a9b6f6d93a4e4e7283a3ea9eb8 100644 (file)
@@ -586,10 +586,8 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
        int ret;
 
        adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL);
        int ret;
 
        adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL);
-       if (!adg) {
-               dev_err(dev, "ADG allocate failed\n");
+       if (!adg)
                return -ENOMEM;
                return -ENOMEM;
-       }
 
        ret = rsnd_mod_init(priv, &adg->mod, &adg_ops,
                      NULL, NULL, 0, 0);
 
        ret = rsnd_mod_init(priv, &adg->mod, &adg_ops,
                      NULL, NULL, 0, 0);
index 2c12ad2b2b3484c973766745238d3ba9dc0b1458..650cc28b0fb6db7df9513bee2ce5ee20c96249ec 100644 (file)
@@ -1401,10 +1401,8 @@ static int rsnd_probe(struct platform_device *pdev)
         *      init priv data
         */
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
         *      init priv data
         */
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-       if (!priv) {
-               dev_err(dev, "priv allocate failed\n");
+       if (!priv)
                return -ENODEV;
                return -ENODEV;
-       }
 
        priv->pdev      = pdev;
        priv->flags     = (unsigned long)of_device_get_match_data(dev);
 
        priv->pdev      = pdev;
        priv->flags     = (unsigned long)of_device_get_match_data(dev);
index ee00e3516911ef32b6fbdd3113f49776231b96a1..f04c4100043a11f39c68d55bca3c99f8dca6ea04 100644 (file)
@@ -406,10 +406,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv)
        int ret;
 
        gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL);
        int ret;
 
        gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL);
-       if (!gen) {
-               dev_err(dev, "GEN allocate failed\n");
+       if (!gen)
                return -ENOMEM;
                return -ENOMEM;
-       }
 
        priv->gen = gen;
 
 
        priv->gen = gen;