public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH v2 4/5] i2c: i801: Add SMBUS_LEN_SENTINEL
Date: Thu, 1 Feb 2024 22:06:26 +0100	[thread overview]
Message-ID: <aab7a892-2dad-4190-b443-14c35f46c776@gmail.com> (raw)
In-Reply-To: <ZbwDm1hEbE3dYCun@smile.fi.intel.com>

On 01.02.2024 21:48, Andy Shevchenko wrote:
> On Thu, Feb 01, 2024 at 09:12:33PM +0100, Heiner Kallweit wrote:
>> Add a sentinel length value that is used to check whether we should
>> read and use the length value provided by the slave device.
>> This simplifies the currently used checks.
> 
> ...
> 
>> +		/* At transfer start i801_smbus_block_transaction() marks
>> +		 * the block length as invalid. Check for this sentinel value
>> +		 * and read the block length from SMBHSTDAT0.
>> +		 */
> 
> /*
>  * May we use the correct multi-line
>  * comment style, please?
>  */
> 

Right, everybody outside netdev uses this comment style

> ...
> 
>> +		/* At transfer start i801_smbus_block_transaction() marks
>> +		 * the block length as invalid. Check for this sentinel value
>> +		 * and read the block length from SMBHSTDAT0.
>> +		 */
> 
> Ditto.
> 
> ...
> 
>>  	if (read_write == I2C_SMBUS_READ && command == I2C_SMBUS_BLOCK_DATA)
>> -		data->block[0] = I2C_SMBUS_BLOCK_MAX;
>> +		data->block[0] = SMBUS_LEN_SENTINEL; /* Mark block length as invalid */
> 
> I would add a separated comment line on top.
> 
OK
>>  	else if (data->block[0] < 1 || data->block[0] > I2C_SMBUS_BLOCK_MAX)
>>  		return -EPROTO;
> 


  reply	other threads:[~2024-02-01 21:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 20:08 [PATCH v2 0/5] i2c: i801: collection of further improvements / refactorings Heiner Kallweit
2024-02-01 20:09 ` [PATCH v2 1/5] i2c: i801: Define FEATURES_ICH5 as an extension of FEATURES_ICH4 Heiner Kallweit
2024-02-01 20:10 ` [PATCH v2 2/5] i2c: i801: Add helper i801_check_and_clear_pec_error Heiner Kallweit
2024-02-01 20:11 ` [PATCH v2 3/5] i2c: i801: Split i801_block_transaction Heiner Kallweit
2024-02-01 20:12 ` [PATCH v2 4/5] i2c: i801: Add SMBUS_LEN_SENTINEL Heiner Kallweit
2024-02-01 20:48   ` Andy Shevchenko
2024-02-01 21:06     ` Heiner Kallweit [this message]
2024-02-01 20:14 ` [PATCH v2 5/5] i2c: i801: Add helper i801_get_block_len Heiner Kallweit

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=aab7a892-2dad-4190-b443-14c35f46c776@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jdelvare@suse.com \
    --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