usb: typec: tcpm/tcpci_maxim: drop STATUS_CHECK()
authorAndré Draszik <andre.draszik@linaro.org>
Wed, 10 Jul 2024 10:36:17 +0000 (11:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Aug 2024 10:49:30 +0000 (12:49 +0200)
Only one user of STATUS_CHECK() remains, and the code can actually be
made more legible by simply avoiding the use of that wrapper macro,
allowing to also drop the macro altogether.

Do so.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240710-tcpc-cleanup-v1-10-0ec1f41f4263@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/maxim_contaminant.c

index e7687aeb69c04e37467507cd8a1c94b5ef676214..8ac8eeade27744b994c32d0cfbd9c0620b623b67 100644 (file)
@@ -46,8 +46,6 @@ enum fladc_select {
 #define READ1_SLEEP_MS                 10
 #define READ2_SLEEP_MS                 5
 
-#define STATUS_CHECK(reg, mask, val)   (((reg) & (mask)) == (val))
-
 #define IS_CC_OPEN(cc_status) \
        (FIELD_GET(TCPC_CC_STATUS_CC1, cc_status) == TCPC_CC_STATE_SRC_OPEN \
         && FIELD_GET(TCPC_CC_STATUS_CC2, cc_status) == TCPC_CC_STATE_SRC_OPEN)
@@ -368,7 +366,7 @@ bool max_contaminant_is_contaminant(struct max_tcpci_chip *chip, bool disconnect
                }
                return false;
        } else if (chip->contaminant_state == DETECTED) {
-               if (STATUS_CHECK(cc_status, TCPC_CC_STATUS_TOGGLING, 0)) {
+               if (!(cc_status & TCPC_CC_STATUS_TOGGLING)) {
                        chip->contaminant_state = max_contaminant_detect_contaminant(chip);
                        if (chip->contaminant_state == DETECTED) {
                                max_contaminant_enable_dry_detection(chip);