diff options
author | Martin Roth <martinroth@chromium.org> | 2016-12-08 10:35:23 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-12-26 10:55:08 -0800 |
commit | b19bb1f22a3fd0102030485d324c0321a18827e8 (patch) | |
tree | 887f3a625f267c5585dad8c383b393cfe0aa81ab | |
parent | 0474fd10cc2113df9fb7757463d50751ca66ce88 (diff) | |
download | chrome-ec-b19bb1f22a3fd0102030485d324c0321a18827e8.tar.gz |
stm32: Remove useless code from usb_power.c
The function usb_power_map_error() is only called from a single
location, with a fixed value passed in, and the return value, which
is the only reason for the function, is ignored.
The whole thing is useless, so remove the function and call. Since the
sizes of all platforms are unchanged before and after removing this, I
suspect it was getting optimized out anyway.
Fixes coverity warning 157563: Useless call
BUG=None
BRANCH=None
TEST=build tested only.
Change-Id: Ie6572d2f5579819f06a53a567e1a93aabca217db
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/418070
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | chip/stm32/usb_power.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/chip/stm32/usb_power.c b/chip/stm32/usb_power.c index b1ba698cc7..60e104a953 100644 --- a/chip/stm32/usb_power.c +++ b/chip/stm32/usb_power.c @@ -22,17 +22,6 @@ static int usb_power_init_inas(struct usb_power_config const *config); static int usb_power_read(struct usb_power_config const *config); static int usb_power_write_line(struct usb_power_config const *config); - -static int8_t usb_power_map_error(int error) -{ - switch (error) { - case EC_SUCCESS: return USB_POWER_SUCCESS; - case EC_ERROR_TIMEOUT: return USB_POWER_ERROR_TIMEOUT; - case EC_ERROR_BUSY: return USB_POWER_ERROR_BUSY; - default: return USB_POWER_ERROR_UNKNOWN | (error & 0x7f); - } -} - void usb_power_deferred_rx(struct usb_power_config const *config) { int rx_count = rx_ep_pending(config->endpoint); @@ -327,7 +316,6 @@ static int usb_power_read(struct usb_power_config const *config) } /* Return result code if applicable. */ - usb_power_map_error(0); ep->in_databuffer[0] = result; usb_write_ep(config->endpoint, in_msgsize, ep->in_databuffer); |