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


Groups > linux.kernel > #1536836

[PATCH 1/1] cpufreq: Fix NULL pointer comparison warning

From Mohamed Wasif <m.wasif@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 1/1] cpufreq: Fix NULL pointer comparison warning
Date 2016-12-06 11:30 +0100
Message-ID <sLlax-Oj-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Replace direct comparisons to NULL
This problem was detected by checkpatch.

Signed-off-by: Mohamed Wasif <m.wasif@samsung.com>
---
 drivers/cpufreq/cpufreq.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6e6c1fb..ca3542e 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -590,7 +590,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
 
 		t = find_governor(str_governor);
 
-		if (t == NULL) {
+		if (!t) {
 			int ret;
 
 			mutex_unlock(&cpufreq_governor_mutex);
@@ -601,7 +601,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
 				t = find_governor(str_governor);
 		}
 
-		if (t != NULL) {
+		if (t) {
 			*governor = t;
 			err = 0;
 		}
-- 
1.7.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] cpufreq: Fix NULL pointer comparison warning Mohamed Wasif <m.wasif@samsung.com> - 2016-12-06 11:30 +0100
  Re: [PATCH 1/1] cpufreq: Fix NULL pointer comparison warning "Rafael J. Wysocki" <rafael@kernel.org> - 2016-12-06 22:10 +0100

csiph-web