* [PATCH] stm class: Use a signed return type for stm_find_master_chan
@ 2016-01-26 2:20 Lucas Tanure
2016-02-05 13:56 ` Alexander Shishkin
0 siblings, 1 reply; 2+ messages in thread
From: Lucas Tanure @ 2016-01-26 2:20 UTC (permalink / raw)
To: Alexander Shishkin; +Cc: linux-kernel
The return type "unsigned int" was used by the stm_find_master_chan function
despite of the aspect that it will eventually return a negative error code.
Done with the help of Coccinelle.
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
drivers/hwtracing/stm/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index b6445d9..cc520f0 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -233,7 +233,7 @@ static int find_free_channels(unsigned long *bitmap, unsigned int start,
return -1;
}
-static unsigned int
+static int
stm_find_master_chan(struct stm_device *stm, unsigned int width,
unsigned int *mstart, unsigned int mend,
unsigned int *cstart, unsigned int cend)
@@ -293,7 +293,7 @@ static int stm_output_assign(struct stm_device *stm, unsigned int width,
goto unlock;
ret = stm_find_master_chan(stm, width, &midx, mend, &cidx, cend);
- if (ret)
+ if (ret < 0)
goto unlock;
output->master = midx;
--
2.7.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] stm class: Use a signed return type for stm_find_master_chan
2016-01-26 2:20 [PATCH] stm class: Use a signed return type for stm_find_master_chan Lucas Tanure
@ 2016-02-05 13:56 ` Alexander Shishkin
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Shishkin @ 2016-02-05 13:56 UTC (permalink / raw)
To: Lucas Tanure; +Cc: linux-kernel
Lucas Tanure <tanure@linux.com> writes:
> The return type "unsigned int" was used by the stm_find_master_chan function
> despite of the aspect that it will eventually return a negative error code.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Lucas Tanure <tanure@linux.com>
Applied to my queue, thank you!
Regards,
--
Alex
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-05 13:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 2:20 [PATCH] stm class: Use a signed return type for stm_find_master_chan Lucas Tanure
2016-02-05 13:56 ` Alexander Shishkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome