Skip to content

Commit 51c9dae

Browse files
committed
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 <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent adcd711 commit 51c9dae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/sbus/char/envctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ static int envctrl_read_cpu_info(int cpu, struct i2c_child_t *pchild,
363363
char mon_type, unsigned char *bufdata)
364364
{
365365
unsigned char data;
366-
int i;
367-
char *tbl, j = -1;
366+
int i, j = -1;
367+
char *tbl;
368368

369369
/* Find the right monitor type and channel. */
370370
for (i = 0; i < PCF8584_MAX_CHANNELS; i++) {

0 commit comments

Comments
 (0)