* [brgl:gpio/for-next 38/38] drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used
@ 2024-07-09 14:21 kernel test robot
2024-07-09 15:13 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-07-09 14:21 UTC (permalink / raw)
To: Bartosz Golaszewski; +Cc: oe-kbuild-all, linux-gpio
tree: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
head: 337049890b8cbbb4fb527c58976ea19f4dc747a0
commit: 91581c4b3f29e2e22aeb1a62e842d529ca638b2d [38/38] gpio: virtuser: new virtual testing driver for the GPIO API
config: microblaze-allmodconfig (https://download.01.org/0day-ci/archive/20240709/202407092245.BPnW2mr6-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240709/202407092245.BPnW2mr6-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407092245.BPnW2mr6-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpio/gpio-virtuser.c: In function 'gpio_virtuser_direction_do_write':
>> drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used [-Wunused-but-set-variable]
400 | char buf[32], *trimmed;
| ^~~~~~~
vim +/trimmed +400 drivers/gpio/gpio-virtuser.c
392
393 static ssize_t gpio_virtuser_direction_do_write(struct file *file,
394 const char __user *user_buf,
395 size_t count, loff_t *ppos,
396 bool atomic)
397 {
398 struct gpio_virtuser_line_data *data = file->private_data;
399 struct gpio_desc *desc = data->ad.desc;
> 400 char buf[32], *trimmed;
401 int ret, dir, val = 0;
402
403 ret = simple_write_to_buffer(buf, sizeof(buf), ppos, user_buf, count);
404 if (ret < 0)
405 return ret;
406
407 trimmed = strim(buf);
408
409 if (strcmp(buf, "input") == 0) {
410 dir = 1;
411 } else if (strcmp(buf, "output-high") == 0) {
412 dir = 0;
413 val = 1;
414 } else if (strcmp(buf, "output-low") == 0) {
415 dir = val = 0;
416 } else {
417 return -EINVAL;
418 }
419
420 if (!atomic)
421 ret = gpio_virtuser_set_direction(desc, dir, val);
422 else
423 ret = gpio_virtuser_set_direction_atomic(desc, dir, val);
424 if (ret)
425 return ret;
426
427 return count;
428 }
429
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [brgl:gpio/for-next 38/38] drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used
2024-07-09 14:21 [brgl:gpio/for-next 38/38] drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used kernel test robot
@ 2024-07-09 15:13 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-07-09 15:13 UTC (permalink / raw)
To: kernel test robot; +Cc: Bartosz Golaszewski, oe-kbuild-all, linux-gpio
On Tue, Jul 9, 2024 at 4:22 PM kernel test robot <lkp@intel.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
> head: 337049890b8cbbb4fb527c58976ea19f4dc747a0
> commit: 91581c4b3f29e2e22aeb1a62e842d529ca638b2d [38/38] gpio: virtuser: new virtual testing driver for the GPIO API
> config: microblaze-allmodconfig (https://download.01.org/0day-ci/archive/20240709/202407092245.BPnW2mr6-lkp@intel.com/config)
> compiler: microblaze-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240709/202407092245.BPnW2mr6-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407092245.BPnW2mr6-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> drivers/gpio/gpio-virtuser.c: In function 'gpio_virtuser_direction_do_write':
> >> drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used [-Wunused-but-set-variable]
> 400 | char buf[32], *trimmed;
> | ^~~~~~~
>
>
> vim +/trimmed +400 drivers/gpio/gpio-virtuser.c
>
Fix sent out.
Bart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-09 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09 14:21 [brgl:gpio/for-next 38/38] drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used kernel test robot
2024-07-09 15:13 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).