public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/7] [media] Hopper: Adjust a null pointer check in two functions
Date: Sat, 2 Sep 2017 22:43:10 +0200	[thread overview]
Message-ID: <56d490a2-4159-204f-cd69-16fd9b268f29@users.sourceforge.net> (raw)
In-Reply-To: <9ba22d42-0ec0-b865-dec5-4ce67ad443fb@users.sourceforge.net>

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

  parent reply	other threads:[~2017-09-02 20:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-02 20:40 [PATCH 0/7] [media] Mantis: Adjustments for three function implementations SF Markus Elfring
2017-09-02 20:41 ` [PATCH 1/7] [media] Hopper: Delete an error message for a failed memory allocation in hopper_pci_probe() SF Markus Elfring
2017-09-02 20:42 ` [PATCH 2/7] [media] Hopper: Improve a size determination " SF Markus Elfring
2017-09-02 20:43 ` SF Markus Elfring [this message]
2017-09-02 20:44 ` [PATCH 4/7] [media] Hopper: Delete an unnecessary variable initialisation " SF Markus Elfring
2017-09-02 20:45 ` [PATCH 5/7] [media] Mantis: Delete an error message for a failed memory allocation in mantis_pci_probe() SF Markus Elfring
2017-09-02 20:46 ` [PATCH 6/7] [media] Mantis: Improve a size determination " SF Markus Elfring
2017-09-02 20:47 ` [PATCH 7/7] [media] Mantis: Delete an unnecessary variable initialisation " 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=56d490a2-4159-204f-cd69-16fd9b268f29@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --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