summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/button.c5
-rw-r--r--common/usbc/usb_pd_dpm.c6
-rw-r--r--common/usbc_ocp.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/common/button.c b/common/button.c
index e63fdb8103..145cd9db74 100644
--- a/common/button.c
+++ b/common/button.c
@@ -62,7 +62,7 @@ static atomic_t sim_button_state;
*/
static int simulated_button_pressed(const struct button_config *button)
{
- return !!(sim_button_state & BIT(button->type));
+ return !!((uint32_t)sim_button_state & BIT(button->type));
}
#endif
@@ -389,7 +389,8 @@ static void simulate_button_release_deferred(void)
/* Release the button */
for (button_idx = 0; button_idx < BUTTON_COUNT; button_idx++) {
/* Check state for button pressed */
- if (sim_button_state & BIT(buttons[button_idx].type)) {
+ if ((uint32_t)sim_button_state &
+ BIT(buttons[button_idx].type)) {
/* Set state of the button as released */
atomic_clear_bits(&sim_button_state,
BIT(buttons[button_idx].type));
diff --git a/common/usbc/usb_pd_dpm.c b/common/usbc/usb_pd_dpm.c
index 4290d96e9b..5deea53d5d 100644
--- a/common/usbc/usb_pd_dpm.c
+++ b/common/usbc/usb_pd_dpm.c
@@ -708,8 +708,8 @@ void dpm_remove_sink(int port)
if (CONFIG_USB_PD_3A_PORTS == 0)
return;
- if (!(BIT(port) & sink_max_pdo_requested) &&
- !(BIT(port) & non_pd_sink_max_requested))
+ if (!(BIT(port) & (uint32_t)sink_max_pdo_requested) &&
+ !(BIT(port) & (uint32_t)non_pd_sink_max_requested))
return;
atomic_clear_bits(&sink_max_pdo_requested, BIT(port));
@@ -730,7 +730,7 @@ void dpm_remove_source(int port)
if (!IS_ENABLED(CONFIG_USB_PD_FRS))
return;
- if (!(BIT(port) & source_frs_max_requested))
+ if (!(BIT(port) & (uint32_t)source_frs_max_requested))
return;
atomic_clear_bits(&source_frs_max_requested, BIT(port));
diff --git a/common/usbc_ocp.c b/common/usbc_ocp.c
index 2654993576..c7c977bf12 100644
--- a/common/usbc_ocp.c
+++ b/common/usbc_ocp.c
@@ -53,7 +53,7 @@ static void clear_oc_tbl(void)
* Only clear the table if the port partner is no longer
* attached after debouncing.
*/
- if ((!(BIT(port) & snk_connected_ports)) &&
+ if ((!(BIT(port) & (uint32_t)snk_connected_ports)) &&
oc_event_cnt_tbl[port]) {
oc_event_cnt_tbl[port] = 0;
CPRINTS("C%d: OC events cleared", port);