Skip to content

Commit

Permalink
stm class: Use a signed return type for stm_find_master_chan
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lucas Tanure authored and Greg Kroah-Hartman committed Feb 20, 2016
1 parent 396ec3d commit f45f40a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwtracing/stm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f45f40a

Please sign in to comment.