diff options
-rw-r--r-- | chip/mec1322/flash.c | 2 | ||||
-rw-r--r-- | common/usb_pd_policy.c | 2 | ||||
-rw-r--r-- | common/usb_pd_protocol.c | 2 | ||||
-rw-r--r-- | common/usb_pd_tcpc.c | 1 | ||||
-rw-r--r-- | core/cortex-m/panic.c | 2 | ||||
-rw-r--r-- | core/cortex-m0/panic.c | 2 | ||||
-rw-r--r-- | driver/als_si114x.c | 1 | ||||
-rw-r--r-- | driver/usb_mux_pi3usb30532.c | 5 |
8 files changed, 11 insertions, 6 deletions
diff --git a/chip/mec1322/flash.c b/chip/mec1322/flash.c index d628109108..194926c15a 100644 --- a/chip/mec1322/flash.c +++ b/chip/mec1322/flash.c @@ -223,6 +223,8 @@ int flash_physical_protect_at_boot(enum flash_wp_range range) size = CONFIG_WP_STORAGE_SIZE; flashwp = SPI_WP_HARDWARE; break; + default: + return EC_ERROR_INVAL; } ret = spi_flash_set_protect(offset, size); diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c index 5cca1075ea..b2bd91a512 100644 --- a/common/usb_pd_policy.c +++ b/common/usb_pd_policy.c @@ -89,7 +89,7 @@ static int pd_find_pdo_index(int cnt, uint32_t *src_caps, int max_mv) int i, uw, max_uw = 0, mv, ma; int ret = -1; #ifdef PD_PREFER_LOW_VOLTAGE - int cur_mv; + int cur_mv = 0; #endif /* max voltage is always limited by this boards max request */ diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 1ecefeb4da..b691fb1b17 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -1382,7 +1382,7 @@ void pd_task(void) enum pd_cc_states new_cc_state; timestamp_t now; int caps_count = 0, hard_reset_sent = 0; - int snk_cap_count; + int snk_cap_count = 0; int evt; /* Ensure the power supply is in the default state */ diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c index 0b13fb2c77..5ca80bb147 100644 --- a/common/usb_pd_tcpc.c +++ b/common/usb_pd_tcpc.c @@ -799,6 +799,7 @@ int tcpc_run(int port, int evt) res = send_hard_reset(port); break; default: + res = PD_TX_ERR_DISABLED; break; } diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c index 092222433a..58887e5cb7 100644 --- a/core/cortex-m/panic.c +++ b/core/cortex-m/panic.c @@ -362,7 +362,7 @@ void exception_panic(void) "mov r3, sp\n" "stmia r0, {r1-r11, lr}\n" "mov sp, %[pstack]\n" - "b report_panic\n" : : + "bl report_panic\n" : : [pregs] "r" (pdata_ptr->cm.regs), [pstack] "r" (pstack_addr) : /* Constraints protecting these from being clobbered. diff --git a/core/cortex-m0/panic.c b/core/cortex-m0/panic.c index 66b3a301b0..9cbc00107a 100644 --- a/core/cortex-m0/panic.c +++ b/core/cortex-m0/panic.c @@ -155,7 +155,7 @@ void exception_panic(void) "mov r5, lr\n" "stmia r0!, {r1-r5}\n" "mov sp, %[pstack]\n" - "b report_panic\n" : : + "bl report_panic\n" : : [pregs] "r" (pdata_ptr->cm.regs), [pstack] "r" (pstack_addr) : /* Constraints protecting these from being clobbered. diff --git a/driver/als_si114x.c b/driver/als_si114x.c index 482678ca15..9a4fd1ff85 100644 --- a/driver/als_si114x.c +++ b/driver/als_si114x.c @@ -241,6 +241,7 @@ static int read(const struct motion_sensor_t *s, vector_3_t v) break; default: CPRINTS("Invalid sensor type"); + return EC_ERROR_INVAL; } ret = raw_write8(s->addr, SI114X_REG_COMMAND, cmd); ret = EC_RES_IN_PROGRESS; diff --git a/driver/usb_mux_pi3usb30532.c b/driver/usb_mux_pi3usb30532.c index ceb80c9368..57f81ff3e9 100644 --- a/driver/usb_mux_pi3usb30532.c +++ b/driver/usb_mux_pi3usb30532.c @@ -26,7 +26,7 @@ static int pi3usb30532_read(int i2c_addr, uint8_t reg, uint8_t *val) if (reg == PI3USB30532_REG_VENDOR) *val = read & 0xff; - else if (reg == PI3USB30532_REG_CONTROL) + else /* reg == PI3USB30532_REG_CONTROL */ *val = (read >> 8) & 0xff; return EC_SUCCESS; @@ -85,7 +85,8 @@ static int pi3usb30532_set_mux(int i2c_addr, mux_state_t mux_state) /* Reads control register and updates mux_state accordingly */ static int pi3usb30532_get_mux(int i2c_addr, mux_state_t *mux_state) { - uint8_t reg, res; + uint8_t reg = 0; + uint8_t res; *mux_state = 0; res = pi3usb30532_read(i2c_addr, PI3USB30532_REG_CONTROL, ®); |