All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Helge Deller <deller@gmx.de>
Cc: Chas Williams <3chas3@gmail.com>,
	linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
	parisc-linux@vger.kernel.org
Subject: Re: [PATCH] atm: firestream: avoid conversion error during build
Date: Tue, 16 Nov 2021 15:11:06 +0100	[thread overview]
Message-ID: <YZO7+mcaAJvZPqTU@lunn.ch> (raw)
In-Reply-To: <YZOmQf6PM+SXiTHX@ls3530>

On Tue, Nov 16, 2021 at 01:38:25PM +0100, Helge Deller wrote:
> Although the firestream driver isn't relevant for the parisc
> architecture, but it generates this compile error when CONFIG_TEST is
> defined:
> 
>  drivers/atm/firestream.c: In function ‘top_off_fp’:
>  arch/parisc/include/asm/io.h:8:25: error: conversion from ‘long unsigned int’ to ‘u32’ {aka ‘unsigned int’} changes value
>      from ‘18446744072635809792’ to ‘3221225472’ [-Werror=overflow]
>  drivers/atm/firestream.c:1494:29: note: in expansion of macro ‘virt_to_bus’
>             ne->next  = virt_to_bus (NULL);
> 
> ne->next is of type u32, so this patch avoids the error by casting
> the return value of virt_to_bus() to u32.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> 
> ---
> 
> diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
> index 3bc3c314a467..8148a4ea194c 100644
> --- a/drivers/atm/firestream.c
> +++ b/drivers/atm/firestream.c
> @@ -1491,7 +1491,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
>  			    skb, ne, skb->data, skb->head);
>  		n++;
>  		ne->flags = FP_FLAGS_EPI | fp->bufsize;
> -		ne->next  = virt_to_bus (NULL);
> +		ne->next  = (u32)virt_to_bus (NULL);
>  		ne->bsa   = virt_to_bus (skb->data);
>  		ne->aal_bufsize = fp->bufsize;
>  		ne->skb = skb;

Does virt_to_bus() make any sense on NULL? Maybe just assign NULL?

     Andrew

      reply	other threads:[~2021-11-16 14:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 12:38 [PATCH] atm: firestream: avoid conversion error during build Helge Deller
2021-11-16 14:11 ` Andrew Lunn [this message]

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=YZO7+mcaAJvZPqTU@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=3chas3@gmail.com \
    --cc=deller@gmx.de \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=parisc-linux@vger.kernel.org \
    /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.