* [dtor-input:next 104/120] drivers/input/serio/serio_raw.c:204:12: warning: variable 'written' is uninitialized when used here
@ 2024-10-20 9:31 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-20 9:31 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: llvm, oe-kbuild-all, linux-input
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
head: 00850d7b542aa4a8240cf977d43dc6d2158e48d7
commit: 5b53a9d40c4f83b44de8da06af9a9c9b3fb14988 [104/120] Input: serio_raw - use guard notation for locks and other resources
config: i386-buildonly-randconfig-002-20241019 (https://download.01.org/0day-ci/archive/20241020/202410201730.ItNhUTIv-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241020/202410201730.ItNhUTIv-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/202410201730.ItNhUTIv-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/input/serio/serio_raw.c:204:12: warning: variable 'written' is uninitialized when used here [-Wuninitialized]
204 | return written ?: -EIO;
| ^~~~~~~
drivers/input/serio/serio_raw.c:188:13: note: initialize the variable 'written' to silence this warning
188 | int written;
| ^
| = 0
1 warning generated.
vim +/written +204 drivers/input/serio/serio_raw.c
182
183 static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
184 size_t count, loff_t *ppos)
185 {
186 struct serio_raw_client *client = file->private_data;
187 struct serio_raw *serio_raw = client->serio_raw;
188 int written;
189 unsigned char c;
190
191 scoped_guard(mutex_intr, &serio_raw_mutex) {
192 if (serio_raw->dead)
193 return -ENODEV;
194
195 if (count > 32)
196 count = 32;
197
198 while (count--) {
199 if (get_user(c, buffer++))
200 return -EFAULT;
201
202 if (serio_write(serio_raw->serio, c)) {
203 /* Either signal error or partial write */
> 204 return written ?: -EIO;
205 }
206
207 written++;
208 }
209
210 return written;
211 }
212
213 return -EINTR;
214 }
215
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-20 9:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-20 9:31 [dtor-input:next 104/120] drivers/input/serio/serio_raw.c:204:12: warning: variable 'written' is uninitialized when used here kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.