Browse Source

staging: typec: tcpm: Rewrite comparison to NULL pointer

Make code more concise and readable

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Harsha Sharma 8 năm trước cách đây
mục cha
commit
4c87b3e58d
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      drivers/usb/typec/tcpm.c

+ 1 - 1
drivers/usb/typec/tcpm.c

@@ -986,7 +986,7 @@ static void svdm_consume_modes(struct tcpm_port *port, const __le32 *payload,
 	}
 	port->partner_altmode[pmdata->altmodes] =
 		typec_partner_register_altmode(port->partner, paltmode);
-	if (port->partner_altmode[pmdata->altmodes] == NULL) {
+	if (!port->partner_altmode[pmdata->altmodes]) {
 		tcpm_log(port,
 			 "Failed to register alternate modes for SVID 0x%04x",
 			 paltmode->svid);