From: Lee Jones <lee@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Andreas Werner <andreas.werner@men.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: menf21bmc: inline i2c_check_functionality check
Date: Thu, 7 May 2026 14:47:08 +0100 [thread overview]
Message-ID: <20260507134708.GN305027@google.com> (raw)
In-Reply-To: <20260428165800.590496-3-thorsten.blum@linux.dev>
On Tue, 28 Apr 2026, Thorsten Blum wrote:
> Inline the i2c_check_functionality() check, since the function returns a
> boolean status rather than an error code.
This my well be a personal thing, but I don't generally like functions
being stuffed into if () statements. So this one is a no I'm afraid.
Please leave it as it is.
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/mfd/menf21bmc.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mfd/menf21bmc.c b/drivers/mfd/menf21bmc.c
> index 1d36095155e0..0f24de516d72 100644
> --- a/drivers/mfd/menf21bmc.c
> +++ b/drivers/mfd/menf21bmc.c
> @@ -54,11 +54,9 @@ menf21bmc_probe(struct i2c_client *client)
> int rev_major, rev_minor, rev_main;
> int ret;
>
> - ret = i2c_check_functionality(client->adapter,
> - I2C_FUNC_SMBUS_BYTE_DATA |
> - I2C_FUNC_SMBUS_WORD_DATA |
> - I2C_FUNC_SMBUS_BYTE);
> - if (!ret)
> + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
> + I2C_FUNC_SMBUS_WORD_DATA |
> + I2C_FUNC_SMBUS_BYTE))
> return -ENODEV;
>
> rev_major = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAJOR);
--
Lee Jones
next parent reply other threads:[~2026-05-07 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260428165800.590496-3-thorsten.blum@linux.dev>
2026-05-07 13:47 ` Lee Jones [this message]
2026-05-07 14:14 ` [PATCH] mfd: menf21bmc: inline i2c_check_functionality check Thorsten Blum
2026-05-14 13:22 ` (subset) " Lee Jones
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=20260507134708.GN305027@google.com \
--to=lee@kernel.org \
--cc=andreas.werner@men.de \
--cc=linux-kernel@vger.kernel.org \
--cc=thorsten.blum@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.