* [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq()
@ 2015-12-19 13:23 ` SF Markus Elfring
0 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2015-12-19 13:23 UTC (permalink / raw)
To: linux-iio, Hartmut Knaack, Jonathan Cameron, Lars-Peter Clausen,
Peter Meerwald
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq()
@ 2015-12-19 13:23 ` SF Markus Elfring
0 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2015-12-19 13:23 UTC (permalink / raw)
To: linux-iio, Hartmut Knaack, Jonathan Cameron, Lars-Peter Clausen,
Peter Meerwald
Cc: LKML, kernel-janitors, Julia Lawall
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq()
2015-12-19 13:23 ` SF Markus Elfring
(?)
@ 2015-12-19 15:02 ` Jonathan Cameron
2015-12-19 16:35 ` Peter Meerwald-Stadler
-1 siblings, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2015-12-19 15:02 UTC (permalink / raw)
To: SF Markus Elfring, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald
Cc: LKML, kernel-janitors, Julia Lawall
On 19/12/15 13:23, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
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;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq()
2015-12-19 15:02 ` Jonathan Cameron
@ 2015-12-19 16:35 ` Peter Meerwald-Stadler
2015-12-19 17:01 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: Peter Meerwald-Stadler @ 2015-12-19 16:35 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: SF Markus Elfring, linux-iio
On Sat, 19 Dec 2015, Jonathan Cameron wrote:
> On 19/12/15 13:23, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > 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 <elfring@users.sourceforge.net>
> 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
Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
> 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;
> >
>
--
Peter Meerwald-Stadler
+43-664-2444418 (mobile)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq()
2015-12-19 16:35 ` Peter Meerwald-Stadler
@ 2015-12-19 17:01 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2015-12-19 17:01 UTC (permalink / raw)
To: Peter Meerwald-Stadler; +Cc: SF Markus Elfring, linux-iio
On 19/12/15 16:35, Peter Meerwald-Stadler wrote:
> On Sat, 19 Dec 2015, Jonathan Cameron wrote:
>
>> On 19/12/15 13:23, SF Markus Elfring wrote:
>>> From: Markus Elfring <elfring@users.sourceforge.net>
>>> 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 <elfring@users.sourceforge.net>
>> 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
> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Added to the commit.
>
>> 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;
>>>
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-19 17:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 13:23 [PATCH] iio-light: Use a signed return type for ltr501_match_samp_freq() SF Markus Elfring
2015-12-19 13:23 ` SF Markus Elfring
2015-12-19 15:02 ` Jonathan Cameron
2015-12-19 16:35 ` Peter Meerwald-Stadler
2015-12-19 17:01 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.