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]
Date:   Thu, 9 Sep 2021 10:15:48 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Networking <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: ni65: Avoid typecast of pointer to u32

On Thu, Sep 9, 2021 at 6:50 AM Guenter Roeck <linux@...ck-us.net> wrote:
>
> Building alpha:allmodconfig results in the following error.
>
> drivers/net/ethernet/amd/ni65.c: In function 'ni65_stop_start':
> drivers/net/ethernet/amd/ni65.c:751:37: error:
>         cast from pointer to integer of different size
>                 buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
>
> 'buffer[]' is declared as unsigned long, so replace the typecast to u32
> with a typecast to unsigned long to fix the problem.
>
> Cc: Arnd Bergmann <arnd@...nel.org>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>

Acked-by: Arnd Bergmann <arnd@...db.de>

> ---
>  drivers/net/ethernet/amd/ni65.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
> index b5df7ad5a83f..032e8922b482 100644
> --- a/drivers/net/ethernet/amd/ni65.c
> +++ b/drivers/net/ethernet/amd/ni65.c
> @@ -748,7 +748,7 @@ static void ni65_stop_start(struct net_device *dev,struct priv *p)
>  #ifdef XMT_VIA_SKB
>                         skb_save[i] = p->tmd_skb[i];
>  #endif
> -                       buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
> +                       buffer[i] = (unsigned long)isa_bus_to_virt(tmdp->u.buffer);

I generally prefer uintptr_t over unsigned long for this cast because it's more
descriptive, but the effect is the same.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ