mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felix Gu <ustc.gu@gmail.com>
To: Romain Gantois <romain.gantois@bootlin.com>,
	 Arnd Bergmann <arnd@arndb.de>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Andi Shyti <andi.shyti@kernel.org>,
	 Wolfram Sang <wsa+renesas@sang-engineering.com>,
	 Linus Walleij <linusw@kernel.org>
Cc: linux-kernel@vger.kernel.org, Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH 2/2] misc: ti_fpc202: remove dead code in fpc202_detach_addr()
Date: Sat, 21 Feb 2026 01:20:32 +0800	[thread overview]
Message-ID: <20260221-fp202-v1-2-4d28cb8b28fb@gmail.com> (raw)
In-Reply-To: <20260221-fp202-v1-0-4d28cb8b28fb@gmail.com>

val is assigned from addr_caches, which is a u8 array. So the check will
never be true.

Found by code review, compile pass.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/misc/ti_fpc202.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/misc/ti_fpc202.c b/drivers/misc/ti_fpc202.c
index 578feefb77f1..79a029d79f7a 100644
--- a/drivers/misc/ti_fpc202.c
+++ b/drivers/misc/ti_fpc202.c
@@ -243,23 +243,15 @@ static void fpc202_detach_addr(struct i2c_atr *atr, u32 chan_id,
 			       u16 addr)
 {
 	struct fpc202_priv *priv = i2c_atr_get_driver_data(atr);
-	int dev_num, reg_mod, val;
+	int dev_num, val;
 
 	for (dev_num = 0; dev_num < 2; dev_num++) {
-		reg_mod = FPC202_REG_MOD_DEV(chan_id, dev_num);
-
 		mutex_lock(&priv->reg_dev_lock);
 
 		val = priv->addr_caches[chan_id][dev_num];
 
 		mutex_unlock(&priv->reg_dev_lock);
 
-		if (val < 0) {
-			dev_err(&priv->client->dev, "failed to read register 0x%x while detaching address 0x%02x\n",
-				reg_mod, addr);
-			return;
-		}
-
 		if (val == (addr & 0x7f)) {
 			fpc202_write_dev_addr(priv, chan_id, dev_num, FPC202_REG_DEV_INVALID);
 			return;

-- 
2.43.0


  parent reply	other threads:[~2026-02-20 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 17:20 [PATCH 0/2] misc: ti_fpc202: two small fixes Felix Gu
2026-02-20 17:20 ` [PATCH 1/2] misc: ti_fpc202: fix off-by-one error in port ID bounds check Felix Gu
2026-02-26 12:49   ` Romain Gantois
2026-02-20 17:20 ` Felix Gu [this message]
2026-02-26 12:53   ` [PATCH 2/2] misc: ti_fpc202: remove dead code in fpc202_detach_addr() Romain Gantois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260221-fp202-v1-2-4d28cb8b28fb@gmail.com \
    --to=ustc.gu@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=romain.gantois@bootlin.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome