lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c9e228d6-d8b5-4041-b50a-c599144c8752@roeck-us.net>
Date:   Wed, 21 Jun 2023 09:44:28 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Rob Herring <robh@...nel.org>
Cc:     Chris Packham <chris.packham@...iedtelesis.co.nz>,
        linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: mpc: Use of_property_read_reg() to parse "reg"

On Fri, Jun 09, 2023 at 12:30:44PM -0600, Rob Herring wrote:
> Use the recently added of_property_read_reg() helper to get the
> untranslated "reg" address value.
> 
> Signed-off-by: Rob Herring <robh@...nel.org>

This patch results in:

Building powerpc:ppc32_allmodconfig ... failed
--------------
Error log:
drivers/i2c/busses/i2c-mpc.c: In function 'mpc_i2c_setup_512x':
drivers/i2c/busses/i2c-mpc.c:310:20: error: unused variable 'pval' [-Werror=unused-variable]
  310 |         const u32 *pval;

because pval is no longer used.

Guenter

> ---
>  drivers/i2c/busses/i2c-mpc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index cfd074ee6d54..595dce9218ad 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -316,9 +316,10 @@ static void mpc_i2c_setup_512x(struct device_node *node,
>  	if (node_ctrl) {
>  		ctrl = of_iomap(node_ctrl, 0);
>  		if (ctrl) {
> +			u64 addr;
>  			/* Interrupt enable bits for i2c-0/1/2: bit 24/26/28 */
> -			pval = of_get_property(node, "reg", NULL);
> -			idx = (*pval & 0xff) / 0x20;
> +			of_property_read_reg(node, 0, &addr, NULL);
> +			idx = (addr & 0xff) / 0x20;
>  			setbits32(ctrl, 1 << (24 + idx * 2));
>  			iounmap(ctrl);
>  		}
> -- 
> 2.39.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ