Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725576 > unrolled thread

[PATCH 3/7] [media] Hopper: Adjust a null pointer check in two functions

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-09-02 22:50 +0200
Last post2017-09-02 22:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/7] [media] Hopper: Adjust a null pointer check in two  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-02 22:50 +0200

#1725576 — [PATCH 3/7] [media] Hopper: Adjust a null pointer check in two functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-02 22:50 +0200
Subject[PATCH 3/7] [media] Hopper: Adjust a null pointer check in two functions
Message-ID<ulnwC-7AM-7@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 2 Sep 2017 21:25:50 +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/pci/mantis/hopper_cards.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c
index fe7b40c306f7..88e5b2a97005 100644
--- a/drivers/media/pci/mantis/hopper_cards.c
+++ b/drivers/media/pci/mantis/hopper_cards.c
@@ -72,7 +72,7 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id)
 	struct mantis_ca *ca;
 
 	mantis = (struct mantis_pci *) dev_id;
-	if (unlikely(mantis == NULL)) {
+	if (unlikely(!mantis)) {
 		dprintk(MANTIS_ERROR, 1, "Mantis == NULL");
 		return IRQ_NONE;
 	}
@@ -164,7 +164,7 @@ static int hopper_pci_probe(struct pci_dev *pdev,
 	int err = 0;
 
 	mantis = kzalloc(sizeof(*mantis), GFP_KERNEL);
-	if (mantis == NULL) {
+	if (!mantis) {
 		err = -ENOMEM;
 		goto fail0;
 	}
-- 
2.14.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web