mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: Fix incorrect type in assignment
@ 2019-10-10  4:38 Wambui Karuga
  2019-10-23 17:30 ` Aaro Koskinen
  0 siblings, 1 reply; 2+ messages in thread
From: Wambui Karuga @ 2019-10-10  4:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: gregkh, devel, linux-kernel, Wambui Karuga

Fix the following warning generated by sparse in
drivers/staging/octeon/ethernet-tx.c:

drivers/staging/octeon/ethernet-tx.c:563:50: warning: incorrect type in assignment (different base types)
drivers/staging/octeon/ethernet-tx.c:563:50:    expected unsigned short [usertype] hw_chksum
drivers/staging/octeon/ethernet-tx.c:563:50:    got restricted __wsum [usertype] csum

Warning generated by running:
make C=2 CF="-D__CHECK_ENDIAN__" drivers/staging/octeon/

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/staging/octeon/octeon-stubs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index 38954b6c89e1..b2e3c72205dd 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -123,7 +123,7 @@ union cvmx_pip_wqe_word0 {
 	struct {
 		uint64_t next_ptr:40;
 		uint8_t unused;
-		uint16_t hw_chksum;
+		__wsum hw_chksum;
 	} cn38xx;
 	struct {
 		uint64_t pknd:6;        /* 0..5 */
-- 
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: octeon: Fix incorrect type in assignment
  2019-10-10  4:38 [PATCH] staging: octeon: Fix incorrect type in assignment Wambui Karuga
@ 2019-10-23 17:30 ` Aaro Koskinen
  0 siblings, 0 replies; 2+ messages in thread
From: Aaro Koskinen @ 2019-10-23 17:30 UTC (permalink / raw)
  To: Wambui Karuga, Greg Kroah-Hartman; +Cc: outreachy-kernel, devel, linux-kernel

Hi,

On Thu, Oct 10, 2019 at 07:38:15AM +0300, Wambui Karuga wrote:
> Fix the following warning generated by sparse in
> drivers/staging/octeon/ethernet-tx.c:
> 
> drivers/staging/octeon/ethernet-tx.c:563:50: warning: incorrect type in assignment (different base types)
> drivers/staging/octeon/ethernet-tx.c:563:50:    expected unsigned short [usertype] hw_chksum
> drivers/staging/octeon/ethernet-tx.c:563:50:    got restricted __wsum [usertype] csum
> 
> Warning generated by running:
> make C=2 CF="-D__CHECK_ENDIAN__" drivers/staging/octeon/
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> ---
>  drivers/staging/octeon/octeon-stubs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> index 38954b6c89e1..b2e3c72205dd 100644
> --- a/drivers/staging/octeon/octeon-stubs.h
> +++ b/drivers/staging/octeon/octeon-stubs.h
> @@ -123,7 +123,7 @@ union cvmx_pip_wqe_word0 {
>  	struct {
>  		uint64_t next_ptr:40;
>  		uint8_t unused;
> -		uint16_t hw_chksum;
> +		__wsum hw_chksum;

I don't think this is correct. This struct defines HW register layout,
and the field needs to be 16 bits.

A.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-23 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  4:38 [PATCH] staging: octeon: Fix incorrect type in assignment Wambui Karuga
2019-10-23 17:30 ` Aaro Koskinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®