linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Mohamed Wasif <m.wasif@samsung.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	vidushi.koul@samsung.com
Subject: Re: [PATCH 1/1] cpufreq: Fix NULL pointer comparison warning
Date: Tue, 6 Dec 2016 15:59:18 +0530	[thread overview]
Message-ID: <20161206102918.GA31255@vireshk-i7> (raw)
In-Reply-To: <1481019475-26636-1-git-send-email-m.wasif@samsung.com>

On 06-12-16, 15:47, Mohamed Wasif wrote:
> 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;
>  		}

What exact checkpatch error did you get ?

This patch would still be not worth it, as the style of comparing with
NULL is just fine. But still I am unable to see the checkpatch warning
in my setup.

-- 
viresh

  reply	other threads:[~2016-12-06 10:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 10:17 [PATCH 1/1] cpufreq: Fix NULL pointer comparison warning Mohamed Wasif
2016-12-06 10:29 ` Viresh Kumar [this message]
2016-12-06 21:03 ` Rafael J. Wysocki

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=20161206102918.GA31255@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=m.wasif@samsung.com \
    --cc=rjw@rjwysocki.net \
    --cc=vidushi.koul@samsung.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).