[brgl:gpio/for-next 38/38] drivers/gpio/gpio-virtuser.c:400:24: warning: variable 'trimmed' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407092245.BPnW2mr6-lkp@xxxxxxxxx/

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




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux