Skip to contentSkip to conversation

i2c: npcm7xx: remove redundant ret variable

PATCH New [email protected] 1 participant 1 message Nov 3, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: npcm7xx: remove redundant ret variable

From: zhang songyi <[email protected]>

Return value from npcm_i2c_get_slave_addr() directly instead of taking this in another redundant variable.

---
 drivers/i2c/busses/i2c-npcm7xx.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/i2c/busses/i2c-npcm7xx.c +1 -5
index bbc7359e67f7..772967862003 100644
@@ -858,14 +858,10 @@ static void npcm_i2c_master_abort(struct npcm_i2c *bus)
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
 static u8 npcm_i2c_get_slave_addr(struct npcm_i2c *bus, enum i2c_addr addr_type)
 {
-   u8 slave_add;
-
    if (addr_type > I2C_SLAVE_ADDR2 && addr_type <= I2C_SLAVE_ADDR10)
        dev_err(bus->dev, "get slave: try to use more than 2 SA not supported\n");
 
-   slave_add = ioread8(bus->reg + npcm_i2caddr[(int)addr_type]);
-
-   return slave_add;
+   return ioread8(bus->reg + npcm_i2caddr[(int)addr_type]);
 }
 
 static int npcm_i2c_remove_slave_addr(struct npcm_i2c *bus, u8 slave_add)

--
2.15.2