public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c: i801: Drop useless masking in i801_access
@ 2022-03-01 16:28 Jean Delvare
  2022-03-01 16:39 ` [PATCH 2/2] i2c: i801: Add support for the Process Call command Jean Delvare
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jean Delvare @ 2022-03-01 16:28 UTC (permalink / raw)
  To: Linux I2C; +Cc: Heiner Kallweit, Jarkko Nikula

I went all the way back to kernel 2.6.12 and that masking was never
needed. I suppose it was there in anticipation of software PEC
support, but that was never added to the driver (and never will be,
as this is made obsolete by hardware PEC).

I'm also removing initialization to 0, which is not needed either,
and would prevent the compiler from reporting an actual usage of
uninitialized variables.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 drivers/i2c/busses/i2c-i801.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-5.16.orig/drivers/i2c/busses/i2c-i801.c	2022-03-01 10:41:26.946201705 +0100
+++ linux-5.16/drivers/i2c/busses/i2c-i801.c	2022-03-01 10:52:45.376001496 +0100
@@ -792,7 +792,7 @@ static s32 i801_access(struct i2c_adapte
 {
 	int hwpec;
 	int block = 0;
-	int ret = 0, xact = 0;
+	int ret, xact;
 	struct i801_priv *priv = i2c_get_adapdata(adap);
 
 	mutex_lock(&priv->acpi_lock);
@@ -904,7 +904,7 @@ static s32 i801_access(struct i2c_adapte
 	if ((read_write == I2C_SMBUS_WRITE) || (xact == I801_QUICK))
 		goto out;
 
-	switch (xact & 0x7f) {
+	switch (xact) {
 	case I801_BYTE:	/* Result put in SMBHSTDAT0 */
 	case I801_BYTE_DATA:
 		data->byte = inb_p(SMBHSTDAT0(priv));


-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-03 18:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-01 16:28 [PATCH 1/2] i2c: i801: Drop useless masking in i801_access Jean Delvare
2022-03-01 16:39 ` [PATCH 2/2] i2c: i801: Add support for the Process Call command Jean Delvare
2022-03-02 14:12   ` Jarkko Nikula
2022-03-02 13:54 ` [PATCH 1/2] i2c: i801: Drop useless masking in i801_access Jarkko Nikula
2022-03-02 21:12 ` Wolfram Sang
2022-03-02 21:13 ` Wolfram Sang
2022-03-03 16:41   ` Jean Delvare
2022-03-03 18:22     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox