Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965139AbbLWKlO (ORCPT ); Wed, 23 Dec 2015 05:41:14 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34591 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965012AbbLWKlK (ORCPT ); Wed, 23 Dec 2015 05:41:10 -0500 Date: Wed, 23 Dec 2015 16:11:06 +0530 From: Viresh Kumar To: Andrzej Hajda Cc: Sudeep Holla , Bartlomiej Zolnierkiewicz , Marek Szyprowski , "Rafael J. Wysocki" , "open list:SYSTEM CONTROL & POWER INTERFACE (SCPI) Message..." , "open list:CPU FREQUENCY DRIVERS" , open list Subject: Re: [PATCH] cpufreq/scpi: fix handling return value of topology_physical_package_id Message-ID: <20151223104105.GB3455@ubuntu> References: <1450867041-729-1-git-send-email-a.hajda@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450867041-729-1-git-send-email-a.hajda@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1295 Lines: 37 On 23-12-15, 11:37, Andrzej Hajda wrote: > The function can return negative values, so its result should > be assigned to signed variable. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 > > Signed-off-by: Andrzej Hajda > --- > drivers/cpufreq/scpi-cpufreq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c > index 2c3b16f..de5e89b 100644 > --- a/drivers/cpufreq/scpi-cpufreq.c > +++ b/drivers/cpufreq/scpi-cpufreq.c > @@ -31,7 +31,7 @@ static struct scpi_ops *scpi_ops; > > static struct scpi_dvfs_info *scpi_get_dvfs_info(struct device *cpu_dev) > { > - u8 domain = topology_physical_package_id(cpu_dev->id); > + int domain = topology_physical_package_id(cpu_dev->id); > > if (domain < 0) > return ERR_PTR(-EINVAL); Acked-by: Viresh Kumar -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/