[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hrA5iCvE2q6T7sqF2Oq2tenhgF--mw9zRoKb0jJXSK=w@mail.gmail.com>
Date: Tue, 6 Dec 2016 22:03:44 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Mohamed Wasif <m.wasif@...sung.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Viresh Kumar <viresh.kumar@...aro.org>,
Linux PM <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
vidushi.koul@...sung.com
Subject: Re: [PATCH 1/1] cpufreq: Fix NULL pointer comparison warning
On Tue, Dec 6, 2016 at 11:17 AM, Mohamed Wasif <m.wasif@...sung.com> wrote:
> Replace direct comparisons to NULL
> This problem was detected by checkpatch.
>
> Signed-off-by: Mohamed Wasif <m.wasif@...sung.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;
> }
> --
The code is correct as is and this patch doesn't fix anything.
Besides, you are supposed to run checkpatch against *patches* and not
against existing code.
Thanks,
Rafael
Powered by blists - more mailing lists