* [PATCH] gpio: virtuser: actually use the "trimmed" local variable
@ 2024-07-09 15:12 Bartosz Golaszewski
2024-07-10 12:18 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-07-09 15:12 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-gpio, linux-kernel, Bartosz Golaszewski, kernel test robot
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407092245.BPnW2mr6-lkp@intel.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-virtuser.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c
index 2ac09c6a3763..0e0d55da4f01 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;
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: virtuser: actually use the "trimmed" local variable
2024-07-09 15:12 [PATCH] gpio: virtuser: actually use the "trimmed" local variable Bartosz Golaszewski
@ 2024-07-10 12:18 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-07-10 12:18 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, kernel test robot
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Tue, 09 Jul 2024 17:12:34 +0200, Bartosz Golaszewski wrote:
> 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.
>
>
Applied, thanks!
[1/1] gpio: virtuser: actually use the "trimmed" local variable
commit: 1d8267bcbb7aa2176365299ad57e067f73b5174d
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-10 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-09 15:12 [PATCH] gpio: virtuser: actually use the "trimmed" local variable Bartosz Golaszewski
2024-07-10 12:18 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®