iio-light: Use a signed return type for ltr501_match_samp_freq()
Subsystems (2)
PATCH 1/1 iio-light: Use a signed return type for ltr501_match_samp_freq()
From: Markus Elfring <[email protected]>
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.
--- drivers/iio/light/ltr501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/ltr501.c +1 -1
@@ -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;
Signature · 1 line
2.6.3
Quoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sat, 19 Dec 2015 14:14:54 +0100The 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 <[email protected]>
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
Quoted 18 lines
--- drivers/iio/light/ltr501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/ltr501.c +1
-1@@ -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;
Peter Meerwald-Stadler
Acked-byQuoted 9 lines · Jonathan Cameron
Quoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sat, 19 Dec 2015 14:14:54 +0100The 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.
Quoted 8 lines
Quoted 3 lines
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>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.
looks good
Quoted 20 lines
Jonathan
Quoted 18 lines
--- drivers/iio/light/ltr501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/ltr501.c +1
-1@@ -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;
Signature · 2 lines
Peter Meerwald-Stadler +43-664-2444418 (mobile)
Jonathan Cameron
maintainerQuoted 14 lines · Peter Meerwald-Stadler
Quoted 12 lines · Jonathan Cameron
Quoted 11 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sat, 19 Dec 2015 14:14:54 +0100The 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 <[email protected]>
Quoted 8 lines
Quoted 5 lines
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.
looks good
Added to the commit.
Quoted 22 lines
Quoted 21 lines
Jonathan
Quoted 18 lines
--- drivers/iio/light/ltr501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/ltr501.c +1
-1@@ -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;