* Subject: [PATCH linux-next] i2c: npcm7xx: remove redundant ret variable
@ 2022-11-03 8:07 zhang.songyi
0 siblings, 0 replies; only message in thread
From: zhang.songyi @ 2022-11-03 8:07 UTC (permalink / raw)
To: avifishman70
Cc: tmaimon77, tali.perry1, venture, yuenn, benjaminfair, openbmc,
linux-i2c, linux-kernel, zhang.songyi
From: zhang songyi <zhang.songyi@zte.com.cn>
Return value from npcm_i2c_get_slave_addr() directly instead of taking
this in another redundant variable.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
drivers/i2c/busses/i2c-npcm7xx.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
index bbc7359e67f7..772967862003 100644
--- a/drivers/i2c/busses/i2c-npcm7xx.c
+++ b/drivers/i2c/busses/i2c-npcm7xx.c
@@ -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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-03 8:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03 8:07 Subject: [PATCH linux-next] i2c: npcm7xx: remove redundant ret variable zhang.songyi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox