* [block:for-5.14/drivers-late 86/87] arch/um/drivers/ubd_kern.c:247:7: warning: variable 'major' set but not used
@ 2021-06-16 1:20 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-16 1:20 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 11591 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.14/drivers-late
head: b12d17fce6418fc1f48f998d55a86fd794ea6578
commit: aebbd9fdb0cc4b7a0eda7b935a929c1e2876a507 [86/87] ubd: remove the code to register as the legacy IDE driver
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=aebbd9fdb0cc4b7a0eda7b935a929c1e2876a507
git remote add block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags block for-5.14/drivers-late
git checkout aebbd9fdb0cc4b7a0eda7b935a929c1e2876a507
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
arch/um/drivers/ubd_kern.c: In function 'ubd_setup_common':
>> arch/um/drivers/ubd_kern.c:247:7: warning: variable 'major' set but not used [-Wunused-but-set-variable]
247 | int major;
| ^~~~~
vim +/major +247 arch/um/drivers/ubd_kern.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 231
d8d7c28ec0b50a Paolo 'Blaisorblade' Giarrusso 2006-10-30 232 /* If *index_out == -1 at exit, the passed option was a general one;
d8d7c28ec0b50a Paolo 'Blaisorblade' Giarrusso 2006-10-30 233 * otherwise, the str pointer is used (and owned) inside ubd_devs array, so it
d8d7c28ec0b50a Paolo 'Blaisorblade' Giarrusso 2006-10-30 234 * should not be freed on exit.
d8d7c28ec0b50a Paolo 'Blaisorblade' Giarrusso 2006-10-30 235 */
f28169d2000177 Jeff Dike 2007-02-10 236 static int ubd_setup_common(char *str, int *index_out, char **error_out)
^1da177e4c3f41 Linus Torvalds 2005-04-16 237 {
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 238 struct ubd *ubd_dev;
^1da177e4c3f41 Linus Torvalds 2005-04-16 239 struct openflags flags = global_openflags;
ef3ba87cb7c911 Christopher Obbard 2020-11-23 240 char *file, *backing_file, *serial;
b8831a1d2c78c0 Jeff Dike 2007-02-10 241 int n, err = 0, i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 242
^1da177e4c3f41 Linus Torvalds 2005-04-16 243 if(index_out) *index_out = -1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 244 n = *str;
^1da177e4c3f41 Linus Torvalds 2005-04-16 245 if(n == '='){
^1da177e4c3f41 Linus Torvalds 2005-04-16 246 char *end;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @247 int major;
^1da177e4c3f41 Linus Torvalds 2005-04-16 248
^1da177e4c3f41 Linus Torvalds 2005-04-16 249 str++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 250 if(!strcmp(str, "sync")){
^1da177e4c3f41 Linus Torvalds 2005-04-16 251 global_openflags = of_sync(global_openflags);
9ca55299f2ee0a Daniel Walter 2019-04-02 252 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 253 }
b8831a1d2c78c0 Jeff Dike 2007-02-10 254
b8831a1d2c78c0 Jeff Dike 2007-02-10 255 err = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 256 major = simple_strtoul(str, &end, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 257 if((*end != '\0') || (end == str)){
f28169d2000177 Jeff Dike 2007-02-10 258 *error_out = "Didn't parse major number";
9ca55299f2ee0a Daniel Walter 2019-04-02 259 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 260 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 261
aebbd9fdb0cc4b Christoph Hellwig 2021-06-14 262 pr_warn("fake major not supported any more\n");
aebbd9fdb0cc4b Christoph Hellwig 2021-06-14 263 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 264 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 265
^1da177e4c3f41 Linus Torvalds 2005-04-16 266 n = parse_unit(&str);
^1da177e4c3f41 Linus Torvalds 2005-04-16 267 if(n < 0){
f28169d2000177 Jeff Dike 2007-02-10 268 *error_out = "Couldn't parse device number";
f28169d2000177 Jeff Dike 2007-02-10 269 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 270 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 271 if(n >= MAX_DEV){
f28169d2000177 Jeff Dike 2007-02-10 272 *error_out = "Device number out of range";
f28169d2000177 Jeff Dike 2007-02-10 273 return 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 274 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 275
f28169d2000177 Jeff Dike 2007-02-10 276 err = -EBUSY;
d7fb2c3865ca0f Paolo 'Blaisorblade' Giarrusso 2006-10-30 277 mutex_lock(&ubd_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 278
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 279 ubd_dev = &ubd_devs[n];
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 280 if(ubd_dev->file != NULL){
f28169d2000177 Jeff Dike 2007-02-10 281 *error_out = "Device is already configured";
^1da177e4c3f41 Linus Torvalds 2005-04-16 282 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 283 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 284
^1da177e4c3f41 Linus Torvalds 2005-04-16 285 if (index_out)
^1da177e4c3f41 Linus Torvalds 2005-04-16 286 *index_out = n;
^1da177e4c3f41 Linus Torvalds 2005-04-16 287
f28169d2000177 Jeff Dike 2007-02-10 288 err = -EINVAL;
50109b5a03b402 Anton Ivanov 2018-11-14 289 for (i = 0; i < sizeof("rscdt="); i++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 290 switch (*str) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 291 case 'r':
^1da177e4c3f41 Linus Torvalds 2005-04-16 292 flags.w = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 293 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 294 case 's':
^1da177e4c3f41 Linus Torvalds 2005-04-16 295 flags.s = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 296 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 297 case 'd':
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 298 ubd_dev->no_cow = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 299 break;
6c29256c5703ad Jeff Dike 2006-03-27 300 case 'c':
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 301 ubd_dev->shared = 1;
6c29256c5703ad Jeff Dike 2006-03-27 302 break;
50109b5a03b402 Anton Ivanov 2018-11-14 303 case 't':
50109b5a03b402 Anton Ivanov 2018-11-14 304 ubd_dev->no_trim = 1;
50109b5a03b402 Anton Ivanov 2018-11-14 305 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 306 case '=':
^1da177e4c3f41 Linus Torvalds 2005-04-16 307 str++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 308 goto break_loop;
^1da177e4c3f41 Linus Torvalds 2005-04-16 309 default:
f28169d2000177 Jeff Dike 2007-02-10 310 *error_out = "Expected '=' or flag letter "
50109b5a03b402 Anton Ivanov 2018-11-14 311 "(r, s, c, t or d)";
^1da177e4c3f41 Linus Torvalds 2005-04-16 312 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 313 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 314 str++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 315 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 316
^1da177e4c3f41 Linus Torvalds 2005-04-16 317 if (*str == '=')
f28169d2000177 Jeff Dike 2007-02-10 318 *error_out = "Too many flags specified";
^1da177e4c3f41 Linus Torvalds 2005-04-16 319 else
f28169d2000177 Jeff Dike 2007-02-10 320 *error_out = "Missing '='";
^1da177e4c3f41 Linus Torvalds 2005-04-16 321 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 322
^1da177e4c3f41 Linus Torvalds 2005-04-16 323 break_loop:
ef3ba87cb7c911 Christopher Obbard 2020-11-23 324 file = strsep(&str, ",:");
ef3ba87cb7c911 Christopher Obbard 2020-11-23 325 if (*file == '\0')
ef3ba87cb7c911 Christopher Obbard 2020-11-23 326 file = NULL;
ef3ba87cb7c911 Christopher Obbard 2020-11-23 327
ef3ba87cb7c911 Christopher Obbard 2020-11-23 328 backing_file = strsep(&str, ",:");
94c41b3a7c370b Hajime Tazaki 2020-12-21 329 if (backing_file && *backing_file == '\0')
ef3ba87cb7c911 Christopher Obbard 2020-11-23 330 backing_file = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 331
ef3ba87cb7c911 Christopher Obbard 2020-11-23 332 serial = strsep(&str, ",:");
94c41b3a7c370b Hajime Tazaki 2020-12-21 333 if (serial && *serial == '\0')
ef3ba87cb7c911 Christopher Obbard 2020-11-23 334 serial = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 335
ef3ba87cb7c911 Christopher Obbard 2020-11-23 336 if (backing_file && ubd_dev->no_cow) {
f28169d2000177 Jeff Dike 2007-02-10 337 *error_out = "Can't specify both 'd' and a cow file";
f28169d2000177 Jeff Dike 2007-02-10 338 goto out;
f28169d2000177 Jeff Dike 2007-02-10 339 }
ef3ba87cb7c911 Christopher Obbard 2020-11-23 340
f28169d2000177 Jeff Dike 2007-02-10 341 err = 0;
ef3ba87cb7c911 Christopher Obbard 2020-11-23 342 ubd_dev->file = file;
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 343 ubd_dev->cow.file = backing_file;
ef3ba87cb7c911 Christopher Obbard 2020-11-23 344 ubd_dev->serial = serial;
7d314e346d6081 Paolo 'Blaisorblade' Giarrusso 2006-10-30 345 ubd_dev->boot_openflags = flags;
^1da177e4c3f41 Linus Torvalds 2005-04-16 346 out:
d7fb2c3865ca0f Paolo 'Blaisorblade' Giarrusso 2006-10-30 347 mutex_unlock(&ubd_lock);
f28169d2000177 Jeff Dike 2007-02-10 348 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 349 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 350
:::::: The code at line 247 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 8635 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-16 1:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 1:20 [block:for-5.14/drivers-late 86/87] arch/um/drivers/ubd_kern.c:247:7: warning: variable 'major' set but not used 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.