From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: linux-i2c@vger.kernel.org
Subject: Re: [PATCH 8/8] i2c: i801: call i801_check_post() from i801_access()
Date: Sat, 17 Dec 2022 18:21:56 +0100 [thread overview]
Message-ID: <97cc53c9-040b-df62-ab29-77cea7913ae1@gmail.com> (raw)
In-Reply-To: <20220610163110.28d50ae6@endymion.delvare>
On 10.06.2022 16:31, Jean Delvare wrote:
> Hi Heiner,
>
> On Fri, 15 Apr 2022 18:59:46 +0200, Heiner Kallweit wrote:
>> Avoid code duplication by calling i801_check_post() from i801_access().
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> drivers/i2c/busses/i2c-i801.c | 20 +++++++++-----------
>> 1 file changed, 9 insertions(+), 11 deletions(-)
>
> Overall I like the idea. I only have one question to make sure I'm not
> missing something.
>
>> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
>> index 9061333f2..ecec7a3a8 100644
>> --- a/drivers/i2c/busses/i2c-i801.c
>> +++ b/drivers/i2c/busses/i2c-i801.c
>> @@ -432,7 +432,7 @@ static int i801_wait_intr(struct i801_priv *priv)
>> busy = status & SMBHSTSTS_HOST_BUSY;
>> status &= STATUS_ERROR_FLAGS | SMBHSTSTS_INTR;
>> if (!busy && status)
>> - return status;
>> + return status & STATUS_ERROR_FLAGS;
>> } while (time_is_after_eq_jiffies(timeout));
>
> Do I understand correctly that this change isn't really related to the
> rest of the patch, and could have been done independently?
>
> You are filtering out SMBHSTSTS_INTR simply because i801_check_post()
> will never check it anyway, right? If so, I wonder if that's really
> something we want to do, as ultimately this adds code with no
> functional benefit just to be "cleaner". But please correct me if I'm
> wrong.
>
Reason is that in few places we check whether return value of
i801_wait_intr() is zero, this would fail if not filtering out SMBHSTSTS_INTR.
Example:
i801_transaction() returns the return value of i801_wait_intr() now.
And in i801_block_transaction_by_block() we check whether return value of
i801_transaction() is zero.
prev parent reply other threads:[~2022-12-17 17:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-15 16:53 [PATCH 0/8] i2c: i801: Series with minor improvements Heiner Kallweit
2022-04-15 16:54 ` [PATCH 1/8] i2c: i801: improve interrupt handler Heiner Kallweit
2022-06-07 12:34 ` Jean Delvare
2022-12-15 22:15 ` Heiner Kallweit
2022-04-15 16:55 ` [PATCH 2/8] i2c: i801: make FEATURE_HOST_NOTIFY dependent on FEATURE_IRQ Heiner Kallweit
2022-06-07 12:48 ` Jean Delvare
2022-12-16 20:23 ` Heiner Kallweit
2022-04-15 16:55 ` [PATCH 3/8] i2c: i801: make FEATURE_BLOCK_PROC dependent on FEATURE_BLOCK_BUFFER Heiner Kallweit
2022-06-07 14:13 ` Jean Delvare
2022-12-16 20:57 ` Heiner Kallweit
2022-04-15 16:56 ` [PATCH 4/8] i2c: i801: enable FEATURE_IRQ and FEATURE_I2C_BLOCK_READ on all chip versions Heiner Kallweit
2022-06-07 14:24 ` Jean Delvare
2022-06-13 17:08 ` Jean Delvare
2022-06-14 12:59 ` Jean Delvare
2022-12-16 21:36 ` Heiner Kallweit
2022-04-15 16:57 ` [PATCH 5/8] i2c: i801: add helper i801_set_hstadd() Heiner Kallweit
2022-06-09 13:53 ` Jean Delvare
2022-12-16 21:37 ` Heiner Kallweit
2022-04-15 16:58 ` [PATCH 6/8] i2c: i801: add i801_single_transaction(), complementing i801_block_transaction() Heiner Kallweit
2022-06-10 11:03 ` Jean Delvare
2022-12-17 17:07 ` Heiner Kallweit
2022-04-15 16:58 ` [PATCH 7/8] i2c: i801: call i801_check_pre() from i801_access() Heiner Kallweit
2022-06-10 13:52 ` Jean Delvare
2022-04-15 16:59 ` [PATCH 8/8] i2c: i801: call i801_check_post() " Heiner Kallweit
2022-06-10 14:31 ` Jean Delvare
2022-12-17 17:21 ` Heiner Kallweit [this message]
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=97cc53c9-040b-df62-ab29-77cea7913ae1@gmail.com \
--to=hkallweit1@gmail.com \
--cc=jdelvare@suse.de \
--cc=linux-i2c@vger.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;
as well as URLs for NNTP newsgroup(s).