Skip to content

Commit 890a48c

Browse files
Dan Carpenterij-intel
authored andcommitted
platform/x86: silicom-platform: clean up a check
The error message in this code can't be reached because value is either zero or non-zero. There isn't a third option. Really, it's nicer to write this as a one liner. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/a58bffb7-0a8b-4195-b273-f65a188ace7b@moroto.mountain Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 214509e commit 890a48c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/platform/x86/silicom-platform.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,7 @@ static void silicom_gpio_set(struct gpio_chip *gc,
256256
if (direction == GPIO_LINE_DIRECTION_IN)
257257
return;
258258

259-
if (value)
260-
silicom_mec_port_set(channel, 0);
261-
else if (value == 0)
262-
silicom_mec_port_set(channel, 1);
263-
else
264-
pr_err("Wrong argument value: %d\n", value);
259+
silicom_mec_port_set(channel, !value);
265260
}
266261

267262
static int silicom_gpio_direction_output(struct gpio_chip *gc,

0 commit comments

Comments
 (0)