From: Jani Nikula <jani.nikula@linux.intel.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel.vetter@intel.com>,
David Airlie <airlied@linux.ie>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 5/9] drm/i915: Adjust seven checks for null pointers
Date: Fri, 05 May 2017 08:46:09 +0300 [thread overview]
Message-ID: <87bmr7yhy6.fsf@intel.com> (raw)
In-Reply-To: <0fb8a6a5-f9ee-1e5d-d52d-5faca3ecde0d@users.sourceforge.net>
On Thu, 04 May 2017, SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 4 May 2017 13:52: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 …
Could be written one way or the other. We have and accept
both. Sometimes explicit comparison with NULL is preferred, depending on
judgement, not based on what a tool says.
BR,
Jani.
>
> Thus fix affected source code places.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index bf9a2e8d8c16..d9c699d7245e 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -242,7 +242,7 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data)
> if (count == total)
> break;
>
> - if (obj->stolen == NULL)
> + if (!obj->stolen)
> continue;
>
> objects[count++] = obj;
> @@ -254,7 +254,7 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data)
> if (count == total)
> break;
>
> - if (obj->stolen == NULL)
> + if (!obj->stolen)
> continue;
>
> objects[count++] = obj;
> @@ -557,7 +557,7 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
>
> spin_lock_irq(&dev->event_lock);
> work = crtc->flip_work;
> - if (work == NULL) {
> + if (!work) {
> seq_printf(m, "No flip due on pipe %c (plane %c)\n",
> pipe, plane);
> } else {
> @@ -3717,7 +3717,7 @@ static ssize_t i915_displayport_test_active_write(struct file *file,
> continue;
>
> if (connector->status == connector_status_connected &&
> - connector->encoder != NULL) {
> + connector->encoder) {
> intel_dp = enc_to_intel_dp(connector->encoder);
> status = kstrtoint(input_buffer, 10, &val);
> if (status < 0)
> @@ -3756,7 +3756,7 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data)
> continue;
>
> if (connector->status == connector_status_connected &&
> - connector->encoder != NULL) {
> + connector->encoder) {
> intel_dp = enc_to_intel_dp(connector->encoder);
> seq_putc(m,
> intel_dp->compliance.test_active ? '1' : '0');
> @@ -3801,7 +3801,7 @@ static int i915_displayport_test_data_show(struct seq_file *m, void *data)
> continue;
>
> if (connector->status == connector_status_connected &&
> - connector->encoder != NULL) {
> + connector->encoder) {
> intel_dp = enc_to_intel_dp(connector->encoder);
> if (intel_dp->compliance.test_type ==
> DP_TEST_LINK_EDID_READ)
> @@ -3855,7 +3855,7 @@ static int i915_displayport_test_type_show(struct seq_file *m, void *data)
> continue;
>
> if (connector->status == connector_status_connected &&
> - connector->encoder != NULL) {
> + connector->encoder) {
> intel_dp = enc_to_intel_dp(connector->encoder);
> seq_printf(m, "%02lx", intel_dp->compliance.test_type);
> } else {
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2017-05-05 5:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <39c8a155-cf89-1aa5-9ca6-4e9ccf3aa602@users.sourceforge.net>
2017-05-04 16:51 ` [PATCH 1/9] drm/i915: Replace ten seq_puts() calls by seq_putc() SF Markus Elfring
2017-05-04 16:52 ` [PATCH 2/9] drm/i915: Combine five seq_printf() calls in i915_display_info() SF Markus Elfring
2017-05-04 16:54 ` [PATCH 3/9] drm/i915: Replace 14 seq_printf() calls by seq_puts() SF Markus Elfring
2017-05-04 20:09 ` Chris Wilson
2017-05-05 5:51 ` Jani Nikula
2017-05-04 16:55 ` [PATCH 4/9] drm/i915: Delete unnecessary braces in three functions SF Markus Elfring
2017-05-05 5:54 ` Jani Nikula
2017-05-04 16:56 ` [PATCH 5/9] drm/i915: Adjust seven checks for null pointers SF Markus Elfring
2017-05-05 5:46 ` Jani Nikula [this message]
2017-05-04 16:58 ` [PATCH 6/9] drm/i915: Add spaces for better code readability SF Markus Elfring
2017-05-05 5:49 ` Jani Nikula
2017-05-04 16:59 ` [PATCH 7/9] drm/i915: Combine substrings for a message in gen6_drpc_info() SF Markus Elfring
2017-05-04 20:12 ` Chris Wilson
2017-05-04 20:48 ` SF Markus Elfring
2017-05-04 20:58 ` Chris Wilson
2017-05-05 4:49 ` Dan Carpenter
2017-05-04 17:00 ` [PATCH 8/9] drm/i915: Replace a seq_puts() call by seq_putc() in two functions SF Markus Elfring
2017-05-04 17:01 ` [PATCH 9/9] drm/i915: Combine substrings for two messages in i915_ggtt_probe_hw() 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=87bmr7yhy6.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=elfring@users.sourceforge.net \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.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