[U-Boot] cmd: gpio: Remove dead code from do_gpio

Message ID 15c70f4f78b33b5c277f02a96b771c4fc4a9b8dd.1528895207.git.michal.simek@xilinx.com
State Under Review
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot] cmd: gpio: Remove dead code from do_gpio
Related show

Commit Message

Michal Simek June 13, 2018, 1:06 p.m.
gpio input/set/clear and toggle commands are already cover that's why
there is no any other case which should be handled.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Reported by: Coverity (local)
Not sure how to report this properly without CID

---
 cmd/gpio.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Tom Rini June 19, 2018, 6:40 p.m. | #1
On Wed, Jun 13, 2018 at 03:06:49PM +0200, Michal Simek wrote:

> gpio input/set/clear and toggle commands are already cover that's why
> there is no any other case which should be handled.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Reported by: Coverity (local)
> Not sure how to report this properly without CID

NAK.  This raises:
w+(e2220-1170) ../cmd/gpio.c: In function 'do_gpio':
w+(e2220-1170) ../cmd/gpio.c:199:3: warning: enumeration value 'GPIO_INPUT' not handled in switch [-Wswitch]

For all platforms that use cmd/gpio.c
Michal Simek June 20, 2018, 6:01 a.m. | #2
On 19.6.2018 20:40, Tom Rini wrote:
> On Wed, Jun 13, 2018 at 03:06:49PM +0200, Michal Simek wrote:
> 
>> gpio input/set/clear and toggle commands are already cover that's why
>> there is no any other case which should be handled.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Reported by: Coverity (local)
>> Not sure how to report this properly without CID
> 
> NAK.  This raises:
> w+(e2220-1170) ../cmd/gpio.c: In function 'do_gpio':
> w+(e2220-1170) ../cmd/gpio.c:199:3: warning: enumeration value 'GPIO_INPUT' not handled in switch [-Wswitch]
> 
> For all platforms that use cmd/gpio.c

Sorry I forget to reply. I found this out later too.

Thanks for dropping,
Michal

Patch

diff --git a/cmd/gpio.c b/cmd/gpio.c
index ecdc453918f4..f59cb5837187 100644
--- a/cmd/gpio.c
+++ b/cmd/gpio.c
@@ -208,8 +208,6 @@  static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			if (!IS_ERR_VALUE(value))
 				value = !value;
 			break;
-		default:
-			goto show_usage;
 		}
 		gpio_direction_output(gpio, value);
 	}