From: Jochen Friedrich <jochen@scram.de>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
Andi Shyti <andi.shyti@kernel.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-i2c@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2] i2c: cpm: Remove linux,i2c-index conversion from be32
Date: Fri, 8 Dec 2023 12:12:13 +0100 [thread overview]
Message-ID: <950ac94b-f488-4879-973e-4014f224c62f@scram.de> (raw)
In-Reply-To: <460afa20784a445dff05b552ebb8c6a389d9de85.1701901105.git.christophe.leroy@csgroup.eu>
Acked-By: Jochen Friedrich <jochen@scram.de>
Am 06.12.2023 um 23:24 schrieb Christophe Leroy:
> sparse reports an error on some data that gets converted from be32.
>
> That's because that data is typed u32 instead of __be32.
>
> The type is correct, the be32_to_cpu() conversion is not.
>
> Remove the conversion.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312042210.QL4DA8Av-lkp@intel.com/
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> v2: Use u32 directly, remove be32_to_cpu().
> ---
> drivers/i2c/busses/i2c-cpm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
> index 9a664abf734d..771d60bc8d71 100644
> --- a/drivers/i2c/busses/i2c-cpm.c
> +++ b/drivers/i2c/busses/i2c-cpm.c
> @@ -658,7 +658,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
> /* register new adapter to i2c module... */
>
> data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
> - cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
> + cpm->adap.nr = (data && len == 4) ? *data : -1;
> result = i2c_add_numbered_adapter(&cpm->adap);
>
> if (result < 0)
next prev parent reply other threads:[~2023-12-08 11:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 22:24 [PATCH v2] i2c: cpm: Remove linux,i2c-index conversion from be32 Christophe Leroy
2023-12-08 11:12 ` Jochen Friedrich [this message]
2023-12-09 0:10 ` Andi Shyti
2023-12-19 17:19 ` Wolfram Sang
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=950ac94b-f488-4879-973e-4014f224c62f@scram.de \
--to=jochen@scram.de \
--cc=andi.shyti@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
/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