Skip to content

Commit 4a74e79

Browse files
ColinIanKingwsakernel
authored andcommitted
i2c: microchip: pci1xxxx: Fix comparison of -EPERM against an unsigned variable
The comparison of variable ret with -EPERM is always false because ret is an u8 type. Fix this by making ret an int. Cleans up clang warning: drivers/i2c/busses/i2c-mchp-pci1xxxx.c:714:10: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare] Fixes: 3616936 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 2bca25e commit 4a74e79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-mchp-pci1xxxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static void pci1xxxx_i2c_init(struct pci1xxxx_i2c *i2c)
708708
void __iomem *p2 = i2c->i2c_base + SMBUS_STATUS_REG_OFF;
709709
void __iomem *p1 = i2c->i2c_base + SMB_GPR_REG;
710710
u8 regval;
711-
u8 ret;
711+
int ret;
712712

713713
ret = set_sys_lock(i2c);
714714
if (ret == -EPERM) {

0 commit comments

Comments
 (0)