Skip to content

Commit 1d8267b

Browse files
author
Bartosz Golaszewski
committed
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: 91581c4 ("gpio: virtuser: new virtual testing driver for the GPIO API") Reported-by: kernel test robot <lkp@intel.com> 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 <bartosz.golaszewski@linaro.org>
1 parent 3370498 commit 1d8267b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-virtuser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,12 @@ static ssize_t gpio_virtuser_direction_do_write(struct file *file,
406406

407407
trimmed = strim(buf);
408408

409-
if (strcmp(buf, "input") == 0) {
409+
if (strcmp(trimmed, "input") == 0) {
410410
dir = 1;
411-
} else if (strcmp(buf, "output-high") == 0) {
411+
} else if (strcmp(trimmed, "output-high") == 0) {
412412
dir = 0;
413413
val = 1;
414-
} else if (strcmp(buf, "output-low") == 0) {
414+
} else if (strcmp(trimmed, "output-low") == 0) {
415415
dir = val = 0;
416416
} else {
417417
return -EINVAL;

0 commit comments

Comments
 (0)