[PATCH v1 01/12] i2c: isch: Add missed 'else'

Andy Shevchenko posted 12 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH v1 01/12] i2c: isch: Add missed 'else'
Posted by Andy Shevchenko 2 months, 2 weeks ago
In accordance with the existing comment and code analysis
it is quite likely that there is a missed 'else' when adapter
times out. Add it.

Fixes: 5bc1200852c3 ("i2c: Add Intel SCH SMBus support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-isch.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c
index 33dbc19d3848..f59158489ad9 100644
--- a/drivers/i2c/busses/i2c-isch.c
+++ b/drivers/i2c/busses/i2c-isch.c
@@ -99,8 +99,7 @@ static int sch_transaction(void)
 	if (retries > MAX_RETRIES) {
 		dev_err(&sch_adapter.dev, "SMBus Timeout!\n");
 		result = -ETIMEDOUT;
-	}
-	if (temp & 0x04) {
+	} else if (temp & 0x04) {
 		result = -EIO;
 		dev_dbg(&sch_adapter.dev, "Bus collision! SMBus may be "
 			"locked until next hard reset. (sorry!)\n");
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 01/12] i2c: isch: Add missed 'else'
Posted by Andi Shyti 2 months, 2 weeks ago
Hi Andy,

On Wed, Sep 11, 2024 at 06:39:14PM GMT, Andy Shevchenko wrote:
> In accordance with the existing comment and code analysis
> it is quite likely that there is a missed 'else' when adapter
> times out. Add it.

Good catch! Very likely this was an oversight.

> Fixes: 5bc1200852c3 ("i2c: Add Intel SCH SMBus support")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I merged just this patch to i2c/i2c-host-fixes.

I will take the rest of the series after the merge window.

Thanks,
Andi
Re: [PATCH v1 01/12] i2c: isch: Add missed 'else'
Posted by Andy Shevchenko 2 months, 2 weeks ago
On Wed, Sep 11, 2024 at 11:35:01PM +0200, Andi Shyti wrote:
> Hi Andy,
> 
> On Wed, Sep 11, 2024 at 06:39:14PM GMT, Andy Shevchenko wrote:
> > In accordance with the existing comment and code analysis
> > it is quite likely that there is a missed 'else' when adapter
> > times out. Add it.
> 
> Good catch! Very likely this was an oversight.
> 
> > Fixes: 5bc1200852c3 ("i2c: Add Intel SCH SMBus support")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> I merged just this patch to i2c/i2c-host-fixes.
> 
> I will take the rest of the series after the merge window.

Fine with me, thanks!

-- 
With Best Regards,
Andy Shevchenko