Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317465 > unrolled thread

[PATCH] stm class: Use a signed return type for stm_find_master_chan

Started byLucas Tanure <tanure@linux.com>
First post2016-01-26 03:30 +0100
Last post2016-01-26 03:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] stm class: Use a signed return type for stm_find_master_chan Lucas Tanure <tanure@linux.com> - 2016-01-26 03:30 +0100

#1317465 — [PATCH] stm class: Use a signed return type for stm_find_master_chan

FromLucas Tanure <tanure@linux.com>
Date2016-01-26 03:30 +0100
Subject[PATCH] stm class: Use a signed return type for stm_find_master_chan
Message-ID<qV1yi-4Nn-1@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web