typec: tcpm: Fix incorrect 'and' operator
Subsystems (3)
PATCH 1/1 typec: tcpm: Fix incorrect 'and' operator
Currently, logical and is being used instead of *bitwise* and.
Fix this by using a proper bitwise and operator.
Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator")
Fixes 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS related
messages")
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- drivers/usb/typec/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm.c +1 -1
@@ -1772,7 +1772,7 @@ static void tcpm_pd_ext_msg_request(struct tcpm_port *port,enum pd_ext_msg_type type =pd_header_type_le (msg->header);unsigned int data_size =pd_ext_header_data_size_le (msg->ext_msg.header); -if (!(msg->ext_msg.header &&PD_EXT_HDR_CHUNKED )) { +if (!(msg->ext_msg.header &PD_EXT_HDR_CHUNKED )) {tcpm_log (port,"Unchunked extended messages unsupported" );return ; }
Signature · 1 line
2.7.4
Quoted 9 lines · Gustavo A. R. Silva
Currently, logical and is being used instead of *bitwise* and.
Fix this by using a proper bitwise and operator.
Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator")
Fixes 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS relatedmessages")
Signed-off-by Gustavo A. R. Silva <[email protected]>---
Good spot. :(
Acked-by Adam Thomson <[email protected]>
Quoted 20 lines
drivers/usb/typec/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/tcpm.c +1
-1@@ -1772,7 +1772,7 @@ static void tcpm_pd_ext_msg_request(struct tcpm_port *port, enum pd_ext_msg_type type = pd_header_type_le(msg->header);unsigned int data_size =pd_ext_header_data_size_le (msg- >ext_msg.header); -if (!(msg->ext_msg.header &&PD_EXT_HDR_CHUNKED )) { +if (!(msg->ext_msg.header &PD_EXT_HDR_CHUNKED )) {tcpm_log (port,"Unchunked extended messages unsupported" );drivers/usb/typec/tcpm.c +0
-1return ; } --2.7.4
Quoted 8 lines · Gustavo A. R. Silva
Currently, logical and is being used instead of *bitwise* and.
Fix this by using a proper bitwise and operator.
Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator")
Fixes 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS relatedmessages")
Signed-off-by Gustavo A. R. Silva <[email protected]>
Acked-by Heikki Krogerus <[email protected]>
Quoted 9 lines
--- drivers/usb/typec/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/tcpm.c +0
-0
drivers/usb/typec/tcpm.c static void tcpm_pd_ext_msg_request(struct tcpm_port *port, · line 1778
Quoted 8 lines
drivers/usb/typec/tcpm.c +1
-1@@ -1772,7 +1772,7 @@ static void tcpm_pd_ext_msg_request(struct tcpm_port *port,enum pd_ext_msg_type type =pd_header_type_le (msg->header);unsigned int data_size =pd_ext_header_data_size_le (msg->ext_msg.header); -if (!(msg->ext_msg.header &&PD_EXT_HDR_CHUNKED )) { +if (!(msg->ext_msg.header &PD_EXT_HDR_CHUNKED )) {tcpm_log (port,"Unchunked extended messages unsupported" );return ; }
Thanks,
Signature · 1 line
heikki