diff mbox series

atm: firestream: avoid conversion error during build

Message ID YZOmQf6PM+SXiTHX@ls3530 (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series atm: firestream: avoid conversion error during build | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: space prohibited between function name and open parenthesis '('
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Helge Deller Nov. 16, 2021, 12:38 p.m. UTC
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>

---

Comments

Andrew Lunn Nov. 16, 2021, 2:11 p.m. UTC | #1
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
diff mbox series

Patch

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;