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, Antti Palosaari <crope@iki.fi>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] [media] it913x: Delete two error messages for a failed memory allocation in it913x_probe()
Date: Sat, 16 Sep 2017 20:31:42 +0200	[thread overview]
Message-ID: <a1686dac-ad24-e46e-c1fc-64f897b458ff@users.sourceforge.net> (raw)
In-Reply-To: <0ad553a6-9aca-d20b-48df-4084d80e2223@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Sep 2017 19:40:47 +0200

* Omit extra messages for a memory allocation failure in this function.

  This issue was detected by using the Coccinelle software.

* Delete the label "err" and the variable "ret" which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/tuners/it913x.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c
index 27e5bc1c3cb5..6af9507823fa 100644
--- a/drivers/media/tuners/it913x.c
+++ b/drivers/media/tuners/it913x.c
@@ -392,14 +392,10 @@ static int it913x_probe(struct platform_device *pdev)
 	struct it913x_dev *dev;
 	const struct platform_device_id *id = platform_get_device_id(pdev);
-	int ret;
 	char *chip_ver_str;
 
 	dev = kzalloc(sizeof(struct it913x_dev), GFP_KERNEL);
-	if (dev == NULL) {
-		ret = -ENOMEM;
-		dev_err(&pdev->dev, "kzalloc() failed\n");
-		goto err;
-	}
+	if (!dev)
+		return -ENOMEM;
 
 	dev->pdev = pdev;
 	dev->regmap = pdata->regmap;
@@ -423,9 +419,6 @@ static int it913x_probe(struct platform_device *pdev)
 		 chip_ver_str);
 	dev_dbg(&pdev->dev, "chip_ver %u, role %u\n", dev->chip_ver, dev->role);
 	return 0;
-err:
-	dev_dbg(&pdev->dev, "failed %d\n", ret);
-	return ret;
 }
 
 static int it913x_remove(struct platform_device *pdev)
-- 
2.14.1

  reply	other threads:[~2017-09-16 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16 18:30 [PATCH 0/2] [media] IT913X: Adjustments for two function implementations SF Markus Elfring
2017-09-16 18:31 ` SF Markus Elfring [this message]
2017-09-16 18:32 ` [PATCH 2/2] [media] it913x: Improve three size determinations 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=a1686dac-ad24-e46e-c1fc-64f897b458ff@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=crope@iki.fi \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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