linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: dri-devel@lists.freedesktop.org,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	David Airlie <airlied@linux.ie>,
	Fabien Dessenne <fabien.dessenne@st.com>,
	Vincent Abriou <vincent.abriou@st.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 5/5] drm/sti: Adjust two checks for null pointers in sti_hqvdp_probe()
Date: Fri, 5 May 2017 15:57:25 +0200	[thread overview]
Message-ID: <918229e6-80fe-629f-8fec-bf60ac15275f@users.sourceforge.net> (raw)
In-Reply-To: <f4a1bd89-50c4-ea2d-ea70-de5209b8a55a@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 5 May 2017 15:33:19 +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/gpu/drm/sti/sti_hqvdp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 372ea294da80..a1c161f77804 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -1356,12 +1356,12 @@ static int sti_hqvdp_probe(struct platform_device *pdev)
 
 	/* Get Memory resources */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res == NULL) {
+	if (!res) {
 		DRM_ERROR("Get memory resource failed\n");
 		return -ENXIO;
 	}
 	hqvdp->regs = devm_ioremap(dev, res->start, resource_size(res));
-	if (hqvdp->regs == NULL) {
+	if (!hqvdp->regs) {
 		DRM_ERROR("Register mapping failed\n");
 		return -ENXIO;
 	}
-- 
2.12.2

  parent reply	other threads:[~2017-05-05 13:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 13:50 [PATCH 0/5] GPU-DRM-STI: Fine-tuning for some function implementations SF Markus Elfring
2017-05-05 13:52 ` [PATCH 1/5] drm/sti: Reduce function calls for sequence output at five places SF Markus Elfring
2017-05-05 13:54 ` [PATCH 2/5] drm/sti: Replace 17 seq_puts() calls by seq_putc() SF Markus Elfring
2017-05-05 13:55 ` [PATCH 3/5] drm/sti: Fix a typo in a comment line SF Markus Elfring
2017-05-05 13:56 ` [PATCH 4/5] drm/sti: Fix typos " SF Markus Elfring
2017-05-05 13:57 ` SF Markus Elfring [this message]
2017-05-05 14:09 ` [PATCH 0/5] GPU-DRM-STI: Fine-tuning for some function implementations Sean Paul
2017-05-05 15:04   ` SF Markus Elfring
2017-05-06 12:33     ` Sean Paul
2017-05-06 13:54       ` SF Markus Elfring
2017-05-06 15:25         ` Sean Paul
2017-05-06 17:00           ` SF Markus Elfring
2017-05-09  8:03             ` Benjamin Gaignard
2017-05-09 10:02               ` Benjamin Gaignard

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=918229e6-80fe-629f-8fec-bf60ac15275f@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=airlied@linux.ie \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabien.dessenne@st.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.abriou@st.com \
    /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;
as well as URLs for NNTP newsgroup(s).