From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933009AbbLSNXm (ORCPT ); Sat, 19 Dec 2015 08:23:42 -0500 Received: from mout.web.de ([212.227.17.11]:60193 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753690AbbLSNXj (ORCPT ); Sat, 19 Dec 2015 08:23:39 -0500 To: linux-iio@vger.kernel.org, Hartmut Knaack , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Subject: [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq() Message-ID: <56755A4D.7000406@users.sourceforge.net> Date: Sat, 19 Dec 2015 14:23:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:DzJUVDp4XiVlJpMro120K+P/D/v9FRUT7Ms9W80G8aJxB7hgdAu rZWCaktpiPHs31RQJzxTut5KIkPLxb5oCmF/Gq5Q2dxCBXB/k+hvIOyz2RBRQZt7t5E1xt6 JnY5xEgbuwCAuDcRAXAiHqX3P/61Ho1I63K/oV/WjvckaoDJ8Zy/NSiwV5OATT6K89FQQgA yBVddJ1vuRvEFO703rDhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Qn/lryazaxQ=:EiASOBFdSHuv2gugXq8Pxg PcdYTIbbEFAOJz5bKZyhRdK/vx30aC/+N/phajwBPFGaAXQq6bBswr15kS2WDxaj7zUzjJQyE KaCWP97PdtMLUd+tHAZdCEDY/9hd/5IXSlySk85WvO5enVl1W4fcSFv4YGCRIZoS/aubRvjC1 o5VU4QSn6DLbfszbQg6HbL/Ueds2Pimd9DiOPie6YNxB3V8qbxNYjwpU6ahYIZBOD0tBNN+/k goNmy6PTA5lv/Y8SiAZ1xeaSXvv+8VAKJxuTODxEcuW/pW2uyH+PLIwkStLl549n3mcHHsT+P t7PF5UfnU3mb3+pJxc90fDvG3l6i6EDxyQUmlUSM1t1uLty7jxtkWE0+s/rSmENTLIcMLOPIy /mscN08schtUa9NoqkOWiRKzKaGqRqBfZWQBGoQn37+z43TzF/OLaNmiNkyu29qxlzxmeMmYo B9NCtBzUqo0JLF5gUYv/70j4j2fYa7umwccM9C6KXOXin+tb6qEZDRIgK1LnjZPcy32n6v0J0 91KH2036BFWmMjLPC2/aQ1W0PER2Tmc7DXbtx9Y9rJJkQzfYhKSNc0CyPcEefwYAEQolgfR3y FLgHO5POtsZHx4OTXRlXpxdgQGjtGPI7thCIu2wm1n2YR7rwJfUESFfG+NbJPQFwoDxODLpnQ RSs4aSaJeXB3dtl8K6KOjjAKgniwMHIChIs1njnclbN7ArppDKV/mzdK2so8/FSno7KEhhC2b SLgTD83gIS7G+21B73CDZnF6Sxm7gL1cDKknYbWqWxSSRMMT6Jn40u+Uf1fJC7Kf4F9ksuL4O hEJot56 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.6.3 From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Sat, 19 Dec 2015 13:23:25 +0000 Subject: [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq() Message-Id: <56755A4D.7000406@users.sourceforge.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-iio@vger.kernel.org, Hartmut Knaack , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall 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 --- 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; -- 2.6.3