Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1635900 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-05-04 19:00 +0200 |
| Last post | 2017-05-05 07:50 +0200 |
| Articles | 2 — 2 participants |
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.
[PATCH 5/9] drm/i915: Adjust seven checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-04 19:00 +0200
Re: [PATCH 5/9] drm/i915: Adjust seven checks for null pointers Jani Nikula <jani.nikula@linux.intel.com> - 2017-05-05 07:50 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-04 19:00 +0200 |
| Subject | [PATCH 5/9] drm/i915: Adjust seven checks for null pointers |
| Message-ID | <tDsgG-6aT-31@gated-at.bofh.it> |
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 …
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 {
--
2.12.2
[toc] | [next] | [standalone]
| From | Jani Nikula <jani.nikula@linux.intel.com> |
|---|---|
| Date | 2017-05-05 07:50 +0200 |
| Message-ID | <tDEhP-5Sk-1@gated-at.bofh.it> |
| In reply to | #1635900 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web