From: Colin Ian King <colin.i.king@gmail.com>
To: Tharun Kumar P <tharunkumar.pasumarthi@microchip.com>,
Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Wolfram Sang <wsa@kernel.org>,
linux-i2c@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] i2c: microchip: pci1xxxx: Fix comparison of -EPERM against an unsigned variable
Date: Tue, 4 Oct 2022 20:27:15 +0100 [thread overview]
Message-ID: <20221004192715.173210-1-colin.i.king@gmail.com> (raw)
The comparison of variable ret with -EPERM is always false because
ret is an u8 type. Fix this by making ret an int.
Cleans up clang warning:
drivers/i2c/busses/i2c-mchp-pci1xxxx.c:714:10: warning: result of comparison
of constant -1 with expression of type 'u8' (aka 'unsigned char') is always
false [-Wtautological-constant-out-of-range-compare]
Fixes: 361693697249 ("i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
index f5342201eb6b..09af75921147 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;
+ int ret;
ret = set_sys_lock(i2c);
if (ret == -EPERM) {
--
2.37.1
next reply other threads:[~2022-10-04 19:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 19:27 Colin Ian King [this message]
2022-10-05 18:53 ` [PATCH][next] i2c: microchip: pci1xxxx: Fix comparison of -EPERM against an unsigned variable Wolfram Sang
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=20221004192715.173210-1-colin.i.king@gmail.com \
--to=colin.i.king@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kumaravel.thiagarajan@microchip.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tharunkumar.pasumarthi@microchip.com \
--cc=wsa@kernel.org \
/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