diff mbox series

i2c: microchip: pci1xxxx: Use signed variable

Message ID 20221004072615.550797-1-usama.anjum@collabora.com
State New
Headers show
Series i2c: microchip: pci1xxxx: Use signed variable | expand

Commit Message

Muhammad Usama Anjum Oct. 4, 2022, 7:26 a.m. UTC
Use signed variable to store the negative values correctly to compare
them later with negative values.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang Oct. 5, 2022, 6:54 p.m. UTC | #1
On Tue, Oct 04, 2022 at 12:26:15PM +0500, Muhammad Usama Anjum wrote:
> Use signed variable to store the negative values correctly to compare
> them later with negative values.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

Thank you, but I appled a better fix (taking care of types) instead:

http://patchwork.ozlabs.org/project/linux-i2c/patch/20221004192715.173210-1-colin.i.king@gmail.com/
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
index b2b7dbff5ef4..f3c497391d13 100644
--- a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
+++ b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
@@ -708,7 +708,7 @@  static void pci1xxxx_i2c_init(struct pci1xxxx_i2c *i2c)
 	void __iomem *p2 = i2c->i2c_base + SMBUS_STATUS_REG_OFF;
 	void __iomem *p1 = i2c->i2c_base + SMB_GPR_REG;
 	u8 regval;
-	u8 ret;
+	s8 ret;
 
 	ret = set_sys_lock(i2c);
 	if (ret == -EPERM) {