staging: octeon: Fix incorrect type in assignment
PATCH 1/1 staging: octeon: Fix incorrect type in assignment
Fix the following warning generated by sparse indrivers/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_chksumdrivers/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/
--- drivers/staging/octeon/octeon-stubs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/octeon/octeon-stubs.h +1 -1
@@ -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 */
Signature · 1 line
2.23.0
Hi,
Quoted 20 lines · 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_chksumdrivers/staging/octeon/ethernet-tx.c:563:50: got restricted__wsum[usertype] csumWarning generated by running:
make C=2 CF="-D__CHECK_ENDIAN__"drivers/staging/octeon/Signed-off-by Wambui Karuga <[email protected]>--- drivers/staging/octeon/octeon-stubs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/octeon/octeon-stubs.h +0
-0
drivers/staging/octeon/octeon-stubs.h union cvmx_pip_wqe_word0 { · line 126
Quoted 5 lines
drivers/staging/octeon/octeon-stubs.h +1
-1@@ -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.