From: Bartosz Golaszewski Date: Tue, 9 Jul 2024 15:12:34 +0000 (+0200) Subject: gpio: virtuser: actually use the "trimmed" local variable X-Git-Tag: v6.11-rc1~208^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d8267bcbb7aa2176365299ad57e067f73b5174d;p=thirdparty%2Fkernel%2Flinux.git gpio: virtuser: actually use the "trimmed" local variable This variable is set with the intention of being passed to the subsequent strcmp() but something went wrong and it was left unused. Use it now. Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202407092245.BPnW2mr6-lkp@intel.com/ Link: https://lore.kernel.org/r/20240709151235.90523-1-brgl@bgdev.pl Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index 2ac09c6a37634..0e0d55da4f011 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -406,12 +406,12 @@ static ssize_t gpio_virtuser_direction_do_write(struct file *file, trimmed = strim(buf); - if (strcmp(buf, "input") == 0) { + if (strcmp(trimmed, "input") == 0) { dir = 1; - } else if (strcmp(buf, "output-high") == 0) { + } else if (strcmp(trimmed, "output-high") == 0) { dir = 0; val = 1; - } else if (strcmp(buf, "output-low") == 0) { + } else if (strcmp(trimmed, "output-low") == 0) { dir = val = 0; } else { return -EINVAL;