* [PATCH] staging: unisys: fix sparse warnings
@ 2017-03-04 17:20 Andrea Ghittino
2017-03-07 12:45 ` Kershner, David A
2017-03-07 20:17 ` Dan Carpenter
0 siblings, 2 replies; 4+ messages in thread
From: Andrea Ghittino @ 2017-03-04 17:20 UTC (permalink / raw)
To: devel, david.kershner, gregkh, sparmaintainer, linux-kernel
Sparse generates two warnings related to incorrect type in assignment.
This patch changes the types in the struct defined in unisys
Signed-off-by: Andrea Ghittino <aghittino@gmail.com>
---
Compile tested only
iochannel.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h
index 54f4900..41e5b4e 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -308,8 +308,8 @@ struct net_pkt_xmt {
u8 valid; /* 1 = struct is valid - else ignore */
u8 hrawoffv; /* 1 = hwrafoff is valid */
u8 nhrawoffv; /* 1 = nhwrafoff is valid */
- u16 protocol; /* specifies packet protocol */
- u32 csum; /* value used to set skb->csum at IOPart */
+ __be16 protocol; /* specifies packet protocol */
+ __wsum csum; /* value used to set skb->csum at IOPart */
u32 hrawoff; /* value used to set skb->h.raw at IOPart */
/* hrawoff points to the start of the TRANSPORT LAYER HEADER */
u32 nhrawoff; /* value used to set skb->nh.raw at IOPart */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] staging: unisys: fix sparse warnings
2017-03-04 17:20 [PATCH] staging: unisys: fix sparse warnings Andrea Ghittino
@ 2017-03-07 12:45 ` Kershner, David A
2017-03-07 20:17 ` Dan Carpenter
1 sibling, 0 replies; 4+ messages in thread
From: Kershner, David A @ 2017-03-07 12:45 UTC (permalink / raw)
To: Andrea Ghittino, devel@driverdev.osuosl.org,
gregkh@linuxfoundation.org, *S-Par-Maintainer,
linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Andrea Ghittino [mailto:aghittino@gmail.com]
> Sent: Saturday, March 4, 2017 12:21 PM
> To: devel@driverdev.osuosl.org; Kershner, David A
> <David.Kershner@unisys.com>; gregkh@linuxfoundation.org; *S-Par-
> Maintainer <SParMaintainer@unisys.com>; linux-kernel@vger.kernel.org
> Subject: [PATCH] staging: unisys: fix sparse warnings
>
> Sparse generates two warnings related to incorrect type in assignment.
> This patch changes the types in the struct defined in unisys
>
> Signed-off-by: Andrea Ghittino <aghittino@gmail.com>
Acked-by: David Kershner <david.kershner@unisys.com>
Tested it on s-Par and no problems.
> ---
> Compile tested only
>
> iochannel.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/unisys/include/iochannel.h
> b/drivers/staging/unisys/include/iochannel.h
> index 54f4900..41e5b4e 100644
> --- a/drivers/staging/unisys/include/iochannel.h
> +++ b/drivers/staging/unisys/include/iochannel.h
> @@ -308,8 +308,8 @@ struct net_pkt_xmt {
> u8 valid; /* 1 = struct is valid - else ignore */
> u8 hrawoffv; /* 1 = hwrafoff is valid */
> u8 nhrawoffv; /* 1 = nhwrafoff is valid */
> - u16 protocol; /* specifies packet protocol */
> - u32 csum; /* value used to set skb->csum at IOPart */
> + __be16 protocol; /* specifies packet protocol */
> + __wsum csum; /* value used to set skb->csum at IOPart */
> u32 hrawoff; /* value used to set skb->h.raw at IOPart */
> /* hrawoff points to the start of the TRANSPORT LAYER
> HEADER */
> u32 nhrawoff; /* value used to set skb->nh.raw at IOPart */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: unisys: fix sparse warnings
2017-03-04 17:20 [PATCH] staging: unisys: fix sparse warnings Andrea Ghittino
2017-03-07 12:45 ` Kershner, David A
@ 2017-03-07 20:17 ` Dan Carpenter
2017-03-07 21:48 ` Andrea Ghittino
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-03-07 20:17 UTC (permalink / raw)
To: Andrea Ghittino
Cc: devel, david.kershner, gregkh, sparmaintainer, linux-kernel
On Sat, Mar 04, 2017 at 06:20:50PM +0100, Andrea Ghittino wrote:
> Sparse generates two warnings related to incorrect type in assignment.
> This patch changes the types in the struct defined in unisys
Can you post the Sparse warning? Otherwise when I'm reviewing this
code I have to re-run Sparse to see what you're talking about.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: unisys: fix sparse warnings
2017-03-07 20:17 ` Dan Carpenter
@ 2017-03-07 21:48 ` Andrea Ghittino
0 siblings, 0 replies; 4+ messages in thread
From: Andrea Ghittino @ 2017-03-07 21:48 UTC (permalink / raw)
To: Dan Carpenter; +Cc: devel, david.kershner, gregkh, sparmaintainer, linux-kernel
On Tue, Mar 07, 2017 at 11:17:36PM +0300, Dan Carpenter wrote:
> On Sat, Mar 04, 2017 at 06:20:50PM +0100, Andrea Ghittino wrote:
> > Sparse generates two warnings related to incorrect type in assignment.
> > This patch changes the types in the struct defined in unisys
>
> Can you post the Sparse warning? Otherwise when I'm reviewing this
> code I have to re-run Sparse to see what you're talking about.
>
> regards,
> dan carpenter
Here you can find sparse warnings:
drivers/staging/unisys/visornic/visornic_main.c:844:50: warning: incorrect type in assignment (different base types)
drivers/staging/unisys/visornic/visornic_main.c:844:50: expected unsigned short [unsigned] [usertype] protocol
drivers/staging/unisys/visornic/visornic_main.c:844:50: got restricted __be16 [usertype] protocol
drivers/staging/unisys/visornic/visornic_main.c:855:46: warning: incorrect type in assignment (different base types)
drivers/staging/unisys/visornic/visornic_main.c:855:46: expected unsigned int [unsigned] [usertype] csum
drivers/staging/unisys/visornic/visornic_main.c:855:46: got restricted __wsum [usertype] csum
andrea
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-07 21:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-04 17:20 [PATCH] staging: unisys: fix sparse warnings Andrea Ghittino
2017-03-07 12:45 ` Kershner, David A
2017-03-07 20:17 ` Dan Carpenter
2017-03-07 21:48 ` Andrea Ghittino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).