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] [thread-next>] [day] [month] [year] [list]
Message-ID: <0bea4002-8160-bebc-2243-c7d4044eb5ad@kernel.org>
Date:   Thu, 10 Aug 2023 22:47:12 +0900
From:   Chanwoo Choi <chanwoo@...nel.org>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Lee Jones <lee@...nel.org>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-stm32@...md-mailman.stormreply.com,
        patches@...nsource.cirrus.com
Cc:     Andi Shyti <andi.shyti@...nel.org>
Subject: Re: [PATCH 2/9] mfd: max14577: Fix Wvoid-pointer-to-enum-cast warning

On 23. 8. 10. 18:58, Krzysztof Kozlowski wrote:
> 'dev_type' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   max14577.c:406:5: error: cast to smaller integer type 'enum maxim_device_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
>  drivers/mfd/max14577.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
> index 25ed8846b7fb..1f4f5002595c 100644
> --- a/drivers/mfd/max14577.c
> +++ b/drivers/mfd/max14577.c
> @@ -402,8 +402,7 @@ static int max14577_i2c_probe(struct i2c_client *i2c)
>  
>  		of_id = of_match_device(max14577_dt_match, &i2c->dev);
>  		if (of_id)
> -			max14577->dev_type =
> -				(enum maxim_device_type)of_id->data;
> +			max14577->dev_type = (uintptr_t)of_id->data;
>  	} else {
>  		max14577->dev_type = id->driver_data;
>  	}

Reviewed-by: Chanwoo Choi <cw00.choi@...sung.com>

-- 
Best Regards,
Samsung Electronics
Chanwoo Choi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ