lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211031628039654230@zte.com.cn>
Date:   Thu, 3 Nov 2022 16:28:03 +0800 (CST)
From:   <zhang.songyi@....com.cn>
To:     <avifishman70@...il.com>
Cc:     <tmaimon77@...il.com>, <tali.perry1@...il.com>,
        <venture@...gle.com>, <yuenn@...gle.com>,
        <benjaminfair@...gle.com>, <openbmc@...ts.ozlabs.org>,
        <linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <zhang.songyi@....com.cn>
Subject: [PATCH linux-next] i2c: npcm7xx: remove redundant ret variable

From: zhang songyi <zhang.songyi@....com.cn>

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

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: zhang songyi <zhang.songyi@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ