mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] [media] xc4000: Adjustments for xc4000_fwupload()
@ 2017-09-09 19:12 SF Markus Elfring
  2017-09-09 19:13 ` [PATCH 1/2] [media] xc4000: Delete two error messages for a failed memory allocation in xc4000_fwupload() SF Markus Elfring
  2017-09-09 19:14 ` [PATCH 2/2] [media] xc4000: Adjust two null pointer checks " SF Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-09 19:12 UTC (permalink / raw)
  To: linux-media, Mauro Carvalho Chehab, Max Kellermann, Sakari Ailus
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Sep 2017 21:00:12 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Delete two error messages for a failed memory allocation
  Adjust two null pointer checks

 drivers/media/tuners/xc4000.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] [media] xc4000: Delete two error messages for a failed memory allocation in xc4000_fwupload()
  2017-09-09 19:12 [PATCH 0/2] [media] xc4000: Adjustments for xc4000_fwupload() SF Markus Elfring
@ 2017-09-09 19:13 ` SF Markus Elfring
  2017-09-09 19:14 ` [PATCH 2/2] [media] xc4000: Adjust two null pointer checks " SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-09 19:13 UTC (permalink / raw)
  To: linux-media, Mauro Carvalho Chehab, Max Kellermann, Sakari Ailus
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Sep 2017 20:46:35 +0200

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

This issue was detected by using the Coccinelle software.

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

diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c
index e30948e4ff87..bbf386127fc4 100644
--- a/drivers/media/tuners/xc4000.c
+++ b/drivers/media/tuners/xc4000.c
@@ -779,4 +779,3 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
-		printk(KERN_ERR "Not enough memory to load firmware file.\n");
 		rc = -ENOMEM;
 		goto done;
 	}
@@ -826,4 +825,3 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
-			printk(KERN_ERR "Not enough memory to load firmware file.\n");
 			rc = -ENOMEM;
 			goto done;
 		}
-- 
2.14.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] [media] xc4000: Adjust two null pointer checks in xc4000_fwupload()
  2017-09-09 19:12 [PATCH 0/2] [media] xc4000: Adjustments for xc4000_fwupload() SF Markus Elfring
  2017-09-09 19:13 ` [PATCH 1/2] [media] xc4000: Delete two error messages for a failed memory allocation in xc4000_fwupload() SF Markus Elfring
@ 2017-09-09 19:14 ` SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-09 19:14 UTC (permalink / raw)
  To: linux-media, Mauro Carvalho Chehab, Max Kellermann, Sakari Ailus
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Sep 2017 20:55:14 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix the affected source code places.

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

diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c
index bbf386127fc4..bd53e44b3cc8 100644
--- a/drivers/media/tuners/xc4000.c
+++ b/drivers/media/tuners/xc4000.c
@@ -775,5 +775,5 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
 		priv->firm_version >> 8, priv->firm_version & 0xff);
 
 	priv->firm = kcalloc(n_array, sizeof(*priv->firm), GFP_KERNEL);
-	if (priv->firm == NULL) {
+	if (!priv->firm) {
 		rc = -ENOMEM;
@@ -821,5 +821,5 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
 		}
 
 		priv->firm[n].ptr = kzalloc(size, GFP_KERNEL);
-		if (priv->firm[n].ptr == NULL) {
+		if (!priv->firm[n].ptr) {
 			rc = -ENOMEM;
-- 
2.14.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-09 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-09 19:12 [PATCH 0/2] [media] xc4000: Adjustments for xc4000_fwupload() SF Markus Elfring
2017-09-09 19:13 ` [PATCH 1/2] [media] xc4000: Delete two error messages for a failed memory allocation in xc4000_fwupload() SF Markus Elfring
2017-09-09 19:14 ` [PATCH 2/2] [media] xc4000: Adjust two null pointer checks " SF Markus Elfring

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