staging: typec: Fix sparse warnings about incorrect types
PATCH 1/1 staging: typec: Fix sparse warnings about incorrect types
Fix the following sparse warnings about incorrect type usage:
fusb302.c:1028:32: warning: incorrect type in argument 1 (different base types)
fusb302.c:1028:32: expected unsigned short [unsigned] [usertype] header
fusb302.c:1028:32: got restricted __le16 const [usertype] header
fusb302.c:1484:32: warning: incorrect type in argument 1 (different base types)
fusb302.c:1484:32: expected unsigned short [unsigned] [usertype] header
fusb302.c:1484:32: got restricted __le16 [usertype] header
--- drivers/staging/typec/fusb302/fusb302.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/typec/fusb302/fusb302.c +2 -2
@@ -1025,7 +1025,7 @@ static int fusb302_pd_send_message(struct fusb302_chip *chip, buf[pos++] =FUSB302_TKN_SYNC1 ; buf[pos++] =FUSB302_TKN_SYNC2 ; - len =pd_header_cnt (msg->header) *4 ; + len =pd_header_cnt_le (msg->header) *4 ;/* plug 2 for header */ len +=2 ;if (len >0x1F ) {
@@ -1481,7 +1481,7 @@ static int fusb302_pd_read_message(struct fusb302_chip *chip, (u8 *)&msg->header);if (ret <0 )return ret; - len =pd_header_cnt (msg->header) *4 ; + len =pd_header_cnt_le (msg->header) *4 ;/* add 4 to length to include the CRC */ if (len >PD_MAX_PAYLOAD *4 ) {fusb302_log (chip,"PD message too long %d" , len);
Signature · 1 line
2.7.4
Quoted 10 lines · Guru Das Srinagesh
Fix the following sparse warnings about incorrect type usage:
fusb302.c:1028:32: warning: incorrect type in argument 1 (different base types)
fusb302.c:1028:32: expected unsigned short [unsigned] [usertype] header
fusb302.c:1028:32: got restricted__le16const [usertype] header
fusb302.c:1484:32: warning: incorrect type in argument 1 (different base types)
fusb302.c:1484:32: expected unsigned short [unsigned] [usertype] header
fusb302.c:1484:32: got restricted__le16[usertype] headerSigned-off-by Guru Das Srinagesh <[email protected]>
Quoted 29 lines
--- drivers/staging/typec/fusb302/fusb302.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/typec/fusb302/fusb302.c +2
-2@@ -1025,7 +1025,7 @@ static int fusb302_pd_send_message(struct fusb302_chip *chip, buf[pos++] =FUSB302_TKN_SYNC1 ; buf[pos++] =FUSB302_TKN_SYNC2 ; - len =pd_header_cnt (msg->header) *4 ; + len =pd_header_cnt_le (msg->header) *4 ;/* plug 2 for header */ len +=2 ;if (len >0x1F ) {@@ -1481,7 +1481,7 @@ static int fusb302_pd_read_message(struct fusb302_chip *chip, (u8 *)&msg->header);if (ret <0 )return ret; - len =pd_header_cnt (msg->header) *4 ; + len =pd_header_cnt_le (msg->header) *4 ;/* add 4 to length to include the CRC */ if (len >PD_MAX_PAYLOAD *4 ) {fusb302_log (chip,"PD message too long %d" , len);Signature · 1 line
2.7.4