summaryrefslogtreecommitdiff
path: root/drivers/sbus
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-10-28 16:22:56 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2022-11-19 00:56:15 +0100
commit51c9daec79b4fa8140cd5490abec4f1f3685ecd8 (patch)
tree3fe982d775d7e750ef1ef9be16bef04bd78a6e00 /drivers/sbus
parentadcd7118caadac54666081be39bbbc3e9b5e1f7d (diff)
sparc: sbus: treat CPU index as integer
Using a `char` to fit a CPU index is too small, and assigning -1 to it isn't correct either, since `char` is sometimes signed and sometimes not. In this case, it's been fine since this driver only works on sparc, but that will soon be changing when chars become unsigned everywhere. So instead, use a normal `int` type, which matches the `int cpu` function argument that this is being compared against. Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/sbus')
-rw-r--r--drivers/sbus/char/envctrl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index 843e830b5f87..ea914a7eaa7f 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -363,8 +363,8 @@ static int envctrl_read_cpu_info(int cpu, struct i2c_child_t *pchild,
char mon_type, unsigned char *bufdata)
{
unsigned char data;
- int i;
- char *tbl, j = -1;
+ int i, j = -1;
+ char *tbl;
/* Find the right monitor type and channel. */
for (i = 0; i < PCF8584_MAX_CHANNELS; i++) {