From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933221AbbLSPCy (ORCPT ); Sat, 19 Dec 2015 10:02:54 -0500 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:55668 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753880AbbLSPCx (ORCPT ); Sat, 19 Dec 2015 10:02:53 -0500 Subject: Re: [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq() To: SF Markus Elfring , linux-iio@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald References: <56755A4D.7000406@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: Jonathan Cameron Message-ID: <56757198.6020001@kernel.org> Date: Sat, 19 Dec 2015 15:02:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56755A4D.7000406@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/12/15 13:23, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 19 Dec 2015 14:14:54 +0100 > > The return type "unsigned int" was used by the ltr501_match_samp_freq() > function despite of the aspect that it will eventually return a negative > error code. > Improve this implementation detail by deletion of the type modifier then. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring Applied to the fixes-togreg branch of iio.git and marked for stable. Peter, I'll probably hold this locally for a few days anyway as Greg hasn't picked up the previous pull request yet. So if you want to add anything give me a shout. Jonathan > --- > drivers/iio/light/ltr501.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c > index 809a961..6bf89d8 100644 > --- a/drivers/iio/light/ltr501.c > +++ b/drivers/iio/light/ltr501.c > @@ -180,7 +180,7 @@ static const struct ltr501_samp_table ltr501_ps_samp_table[] = { > {500000, 2000000} > }; > > -static unsigned int ltr501_match_samp_freq(const struct ltr501_samp_table *tab, > +static int ltr501_match_samp_freq(const struct ltr501_samp_table *tab, > int len, int val, int val2) > { > int i, freq; >