CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] TO: "Rafael J. Wysocki" <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git acpica-osl head: 3537ee81aa84bbcf47f7239f1053686d71bea47d commit: 3537ee81aa84bbcf47f7239f1053686d71bea47d [3/3] ACPI: OSL: Define ACPI_OS_MAP_MEMORY_FAST_PATH() :::::: branch date: 23 hours ago :::::: commit date: 23 hours ago config: x86_64-randconfig-m001-20200611 (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> New smatch warnings: drivers/acpi/osl.c:313 __acpi_os_map_iomem() warn: impossible condition '(phys > (~0)) => (0-u64max > u64max)' Old smatch warnings: drivers/acpi/osl.c:1608 acpi_release_memory() warn: ignoring unreachable code. # https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?id=3537ee81aa84bbcf47f7239f1053686d71bea47d git remote add pm https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git git remote update pm git checkout 3537ee81aa84bbcf47f7239f1053686d71bea47d vim +313 drivers/acpi/osl.c ba242d5b1a84bc Myron Stowe 2012-01-20 304 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 305 static void __iomem __ref *__acpi_os_map_iomem(acpi_physical_address phys, 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 306 acpi_size size, bool fast_path) ^1da177e4c3f41 Linus Torvalds 2005-04-16 307 { 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 308 struct acpi_ioremap *map; 620242ae8c3d9c Myron Stowe 2010-10-21 309 void __iomem *virt; 2d6d9fd3a54a28 Rafael J. Wysocki 2011-01-19 310 acpi_physical_address pg_off; 2d6d9fd3a54a28 Rafael J. Wysocki 2011-01-19 311 acpi_size pg_sz; 620242ae8c3d9c Myron Stowe 2010-10-21 312 ^1da177e4c3f41 Linus Torvalds 2005-04-16 @313 if (phys > ULONG_MAX) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 314 printk(KERN_ERR PREFIX "Cannot map memory that high\n"); 70c0846e430881 Randy Dunlap 2007-02-13 315 return NULL; ^1da177e4c3f41 Linus Torvalds 2005-04-16 316 } 620242ae8c3d9c Myron Stowe 2010-10-21 317 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 318 if (!acpi_permanent_mmap) { 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 319 if (WARN_ON(fast_path)) 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 320 return NULL; 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 321 ad71860a17ba33 Alexey Starikovskiy 2007-02-02 322 return __acpi_map_table((unsigned long)phys, size); 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 323 } 620242ae8c3d9c Myron Stowe 2010-10-21 324 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 325 mutex_lock(&acpi_ioremap_lock); 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 326 /* Check if there's a suitable mapping already. */ 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 327 map = acpi_map_lookup(phys, size); 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 328 if (map) { b7c1fadd6c2eea Rafael J. Wysocki 2011-02-08 329 map->refcount++; 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 330 goto out; 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 331 } 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 332 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 333 if (fast_path) { 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 334 mutex_unlock(&acpi_ioremap_lock); 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 335 return NULL; 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 336 } 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 337 620242ae8c3d9c Myron Stowe 2010-10-21 338 map = kzalloc(sizeof(*map), GFP_KERNEL); 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 339 if (!map) { 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 340 mutex_unlock(&acpi_ioremap_lock); 620242ae8c3d9c Myron Stowe 2010-10-21 341 return NULL; 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 342 } 620242ae8c3d9c Myron Stowe 2010-10-21 343 4a3cba5e72a523 Myron Stowe 2010-10-21 344 pg_off = round_down(phys, PAGE_SIZE); 4a3cba5e72a523 Myron Stowe 2010-10-21 345 pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; ba242d5b1a84bc Myron Stowe 2012-01-20 346 virt = acpi_map(pg_off, pg_sz); 620242ae8c3d9c Myron Stowe 2010-10-21 347 if (!virt) { 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 348 mutex_unlock(&acpi_ioremap_lock); 620242ae8c3d9c Myron Stowe 2010-10-21 349 kfree(map); 620242ae8c3d9c Myron Stowe 2010-10-21 350 return NULL; 620242ae8c3d9c Myron Stowe 2010-10-21 351 } 620242ae8c3d9c Myron Stowe 2010-10-21 352 620242ae8c3d9c Myron Stowe 2010-10-21 353 INIT_LIST_HEAD(&map->list); 620242ae8c3d9c Myron Stowe 2010-10-21 354 map->virt = virt; 4a3cba5e72a523 Myron Stowe 2010-10-21 355 map->phys = pg_off; 4a3cba5e72a523 Myron Stowe 2010-10-21 356 map->size = pg_sz; b7c1fadd6c2eea Rafael J. Wysocki 2011-02-08 357 map->refcount = 1; 620242ae8c3d9c Myron Stowe 2010-10-21 358 78cdb3ed405379 Myron Stowe 2010-10-21 359 list_add_tail_rcu(&map->list, &acpi_ioremaps); 620242ae8c3d9c Myron Stowe 2010-10-21 360 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 361 out: 7ffd0443f25024 Rafael J. Wysocki 2011-02-08 362 mutex_unlock(&acpi_ioremap_lock); 4a3cba5e72a523 Myron Stowe 2010-10-21 363 return map->virt + (phys - map->phys); ^1da177e4c3f41 Linus Torvalds 2005-04-16 364 } 3537ee81aa84bb Rafael J. Wysocki 2020-06-10 365 :::::: The code at line 313 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <[email protected]> :::::: CC: Linus Torvalds <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
