From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Heiner Kallweit <hkallweit1@gmail.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:48:27 +0200 [thread overview]
Message-ID: <ZbwDm1hEbE3dYCun@smile.fi.intel.com> (raw)
In-Reply-To: <9d06c7d6-8c62-4e44-9e3e-334ac14e38a1@gmail.com>
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?
*/
...
> + /* 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.
> else if (data->block[0] < 1 || data->block[0] > I2C_SMBUS_BLOCK_MAX)
> return -EPROTO;
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-02-01 20:48 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 [this message]
2024-02-01 21:06 ` Heiner Kallweit
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=ZbwDm1hEbE3dYCun@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hkallweit1@gmail.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