Re: [PATCH 06/16] mm/pagemap: Cleanup PREEMPT_COUNT leftovers
by kernel test robot
Hi "Uladzislau,
I love your patch! Perhaps something to improve:
[auto build test WARNING on arm/for-next]
[also build test WARNING on tip/sched/core linus/master v5.10-rc1]
[cannot apply to rcu/dev drm-intel/for-linux-next next-20201029]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Uladzislau-Rezki-Sony/rcu-tree-A...
base: git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: arm-randconfig-r004-20201029 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 772aaa602383cf82795572ebcd86b0e660f3579f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/1e0b66ce2b779463194f8b398b8e48caa...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Uladzislau-Rezki-Sony/rcu-tree-Add-a-work-to-allocate-pages-from-regular-context/20201030-005247
git checkout 1e0b66ce2b779463194f8b398b8e48caa95aabf4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/char/random.c:348:
In file included from include/trace/events/random.h:8:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:14:
include/linux/pagemap.h:207:26: error: expected ';' after do/while statement
VM_BUG_ON(preemptible())
^
;
>> drivers/char/random.c:1269:41: warning: shift count >= width of type [-Wshift-count-overflow]
c_high = (sizeof(cycles) > 4) ? cycles >> 32 : 0;
^ ~~
drivers/char/random.c:1270:35: warning: shift count >= width of type [-Wshift-count-overflow]
j_high = (sizeof(now) > 4) ? now >> 32 : 0;
^ ~~
drivers/char/random.c:2296:6: warning: no previous prototype for function 'add_hwgenerator_randomness' [-Wmissing-prototypes]
void add_hwgenerator_randomness(const char *buffer, size_t count,
^
drivers/char/random.c:2296:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void add_hwgenerator_randomness(const char *buffer, size_t count,
^
static
3 warnings and 1 error generated.
--
In file included from drivers/usb/host/ehci-platform.c:37:
In file included from include/linux/usb/of.h:12:
In file included from include/linux/usb/otg.h:13:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:14:
include/linux/pagemap.h:207:26: error: expected ';' after do/while statement
VM_BUG_ON(preemptible())
^
;
>> drivers/usb/host/ehci-platform.c:259:24: warning: shift count >= width of type [-Wshift-count-overflow]
pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
1 warning and 1 error generated.
--
In file included from drivers/usb/host/xhci-plat.c:21:
In file included from include/linux/usb/of.h:12:
In file included from include/linux/usb/otg.h:13:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:14:
include/linux/pagemap.h:207:26: error: expected ';' after do/while statement
VM_BUG_ON(preemptible())
^
;
>> drivers/usb/host/xhci-plat.c:222:10: warning: shift count >= width of type [-Wshift-count-overflow]
DMA_BIT_MASK(64));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
drivers/usb/host/xhci-plat.c:224:43: warning: shift count >= width of type [-Wshift-count-overflow]
ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(64));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
2 warnings and 1 error generated.
--
In file included from drivers/mmc/host/sdhci.c:24:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:14:
include/linux/pagemap.h:207:26: error: expected ';' after do/while statement
VM_BUG_ON(preemptible())
^
;
>> drivers/mmc/host/sdhci.c:3953:40: warning: shift count >= width of type [-Wshift-count-overflow]
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
drivers/mmc/host/sdhci.c:4254:20: warning: shift count >= width of type [-Wshift-count-overflow]
host->dma_mask = DMA_BIT_MASK(64);
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
2 warnings and 1 error generated.
vim +1269 drivers/char/random.c
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1254
775f4b297b78060 Theodore Ts'o 2012-07-02 1255 void add_interrupt_randomness(int irq, int irq_flags)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1256 {
775f4b297b78060 Theodore Ts'o 2012-07-02 1257 struct entropy_store *r;
1b2a1a7e8ad1144 Christoph Lameter 2014-08-17 1258 struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness);
775f4b297b78060 Theodore Ts'o 2012-07-02 1259 struct pt_regs *regs = get_irq_regs();
775f4b297b78060 Theodore Ts'o 2012-07-02 1260 unsigned long now = jiffies;
655b226470b2295 Theodore Ts'o 2013-09-22 1261 cycles_t cycles = random_get_entropy();
43759d4f429c8d5 Theodore Ts'o 2014-06-14 1262 __u32 c_high, j_high;
655b226470b2295 Theodore Ts'o 2013-09-22 1263 __u64 ip;
83664a6928a420b H. Peter Anvin 2014-03-17 1264 unsigned long seed;
91fcb532efe366d Theodore Ts'o 2014-06-10 1265 int credit = 0;
655b226470b2295 Theodore Ts'o 2013-09-22 1266
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1267 if (cycles == 0)
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1268 cycles = get_reg(fast_pool, regs);
655b226470b2295 Theodore Ts'o 2013-09-22 @1269 c_high = (sizeof(cycles) > 4) ? cycles >> 32 : 0;
655b226470b2295 Theodore Ts'o 2013-09-22 1270 j_high = (sizeof(now) > 4) ? now >> 32 : 0;
43759d4f429c8d5 Theodore Ts'o 2014-06-14 1271 fast_pool->pool[0] ^= cycles ^ j_high ^ irq;
43759d4f429c8d5 Theodore Ts'o 2014-06-14 1272 fast_pool->pool[1] ^= now ^ c_high;
655b226470b2295 Theodore Ts'o 2013-09-22 1273 ip = regs ? instruction_pointer(regs) : _RET_IP_;
43759d4f429c8d5 Theodore Ts'o 2014-06-14 1274 fast_pool->pool[2] ^= ip;
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1275 fast_pool->pool[3] ^= (sizeof(ip) > 4) ? ip >> 32 :
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1276 get_reg(fast_pool, regs);
3060d6fe2857064 Yinghai Lu 2008-08-19 1277
43759d4f429c8d5 Theodore Ts'o 2014-06-14 1278 fast_mix(fast_pool);
43759d4f429c8d5 Theodore Ts'o 2014-06-14 1279 add_interrupt_bench(cycles);
3060d6fe2857064 Yinghai Lu 2008-08-19 1280
43838a23a05fbd1 Theodore Ts'o 2018-04-11 1281 if (unlikely(crng_init == 0)) {
e192be9d9a30555 Theodore Ts'o 2016-06-12 1282 if ((fast_pool->count >= 64) &&
e192be9d9a30555 Theodore Ts'o 2016-06-12 1283 crng_fast_load((char *) fast_pool->pool,
e192be9d9a30555 Theodore Ts'o 2016-06-12 1284 sizeof(fast_pool->pool))) {
e192be9d9a30555 Theodore Ts'o 2016-06-12 1285 fast_pool->count = 0;
e192be9d9a30555 Theodore Ts'o 2016-06-12 1286 fast_pool->last = now;
e192be9d9a30555 Theodore Ts'o 2016-06-12 1287 }
e192be9d9a30555 Theodore Ts'o 2016-06-12 1288 return;
e192be9d9a30555 Theodore Ts'o 2016-06-12 1289 }
e192be9d9a30555 Theodore Ts'o 2016-06-12 1290
840f95077ffd640 Theodore Ts'o 2014-06-14 1291 if ((fast_pool->count < 64) &&
840f95077ffd640 Theodore Ts'o 2014-06-14 1292 !time_after(now, fast_pool->last + HZ))
^1da177e4c3f415 Linus Torvalds 2005-04-16 1293 return;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1294
e192be9d9a30555 Theodore Ts'o 2016-06-12 1295 r = &input_pool;
840f95077ffd640 Theodore Ts'o 2014-06-14 1296 if (!spin_trylock(&r->lock))
91fcb532efe366d Theodore Ts'o 2014-06-10 1297 return;
83664a6928a420b H. Peter Anvin 2014-03-17 1298
91fcb532efe366d Theodore Ts'o 2014-06-10 1299 fast_pool->last = now;
85608f8e16c28f8 Theodore Ts'o 2014-06-10 1300 __mix_pool_bytes(r, &fast_pool->pool, sizeof(fast_pool->pool));
83664a6928a420b H. Peter Anvin 2014-03-17 1301
83664a6928a420b H. Peter Anvin 2014-03-17 1302 /*
83664a6928a420b H. Peter Anvin 2014-03-17 1303 * If we have architectural seed generator, produce a seed and
48d6be955a7167b Theodore Ts'o 2014-07-17 1304 * add it to the pool. For the sake of paranoia don't let the
48d6be955a7167b Theodore Ts'o 2014-07-17 1305 * architectural seed generator dominate the input from the
48d6be955a7167b Theodore Ts'o 2014-07-17 1306 * interrupt noise.
83664a6928a420b H. Peter Anvin 2014-03-17 1307 */
83664a6928a420b H. Peter Anvin 2014-03-17 1308 if (arch_get_random_seed_long(&seed)) {
85608f8e16c28f8 Theodore Ts'o 2014-06-10 1309 __mix_pool_bytes(r, &seed, sizeof(seed));
48d6be955a7167b Theodore Ts'o 2014-07-17 1310 credit = 1;
83664a6928a420b H. Peter Anvin 2014-03-17 1311 }
91fcb532efe366d Theodore Ts'o 2014-06-10 1312 spin_unlock(&r->lock);
83664a6928a420b H. Peter Anvin 2014-03-17 1313
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1314 fast_pool->count = 0;
83664a6928a420b H. Peter Anvin 2014-03-17 1315
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1316 /* award one bit for the contents of the fast pool */
ee3e00e9e7101c8 Theodore Ts'o 2014-06-15 1317 credit_entropy_bits(r, credit + 1);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1318 }
4b44f2d18a33056 Stephan Mueller 2016-05-02 1319 EXPORT_SYMBOL_GPL(add_interrupt_randomness);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1320
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[linux-next:master 1359/2564] include/linux/device/driver.h:290:1: error: type defaults to 'int' in declaration of 'device_initcall'
by kernel test robot
Hi Dong,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 3f267ec60b922eff2a5c90d532357a39f155b730
commit: 77d8f3068c63ee0983f0b5ba3207d3f7cce11be4 [1359/2564] clk: imx: scu: add two cells binding support
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 77d8f3068c63ee0983f0b5ba3207d3f7cce11be4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/device.h:32,
from include/linux/of_platform.h:9,
from drivers/clk/imx/clk-scu.c:11:
include/linux/device/driver.h:290:1: warning: data definition has no type or storage class
290 | device_initcall(__driver##_init);
| ^~~~~~~~~~~~~~~
include/linux/platform_device.h:258:2: note: in expansion of macro 'builtin_driver'
258 | builtin_driver(__platform_driver, platform_driver_register)
| ^~~~~~~~~~~~~~
drivers/clk/imx/clk-scu.c:477:1: note: in expansion of macro 'builtin_platform_driver'
477 | builtin_platform_driver(imx_clk_scu_driver);
| ^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/device/driver.h:290:1: error: type defaults to 'int' in declaration of 'device_initcall' [-Werror=implicit-int]
290 | device_initcall(__driver##_init);
| ^~~~~~~~~~~~~~~
include/linux/platform_device.h:258:2: note: in expansion of macro 'builtin_driver'
258 | builtin_driver(__platform_driver, platform_driver_register)
| ^~~~~~~~~~~~~~
drivers/clk/imx/clk-scu.c:477:1: note: in expansion of macro 'builtin_platform_driver'
477 | builtin_platform_driver(imx_clk_scu_driver);
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/imx/clk-scu.c:477:1: warning: parameter names (without types) in function declaration
In file included from include/linux/device.h:32,
from include/linux/of_platform.h:9,
from drivers/clk/imx/clk-scu.c:11:
drivers/clk/imx/clk-scu.c:477:25: warning: 'imx_clk_scu_driver_init' defined but not used [-Wunused-function]
477 | builtin_platform_driver(imx_clk_scu_driver);
| ^~~~~~~~~~~~~~~~~~
include/linux/device/driver.h:286:19: note: in definition of macro 'builtin_driver'
286 | static int __init __driver##_init(void) \
| ^~~~~~~~
drivers/clk/imx/clk-scu.c:477:1: note: in expansion of macro 'builtin_platform_driver'
477 | builtin_platform_driver(imx_clk_scu_driver);
| ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +290 include/linux/device/driver.h
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 269
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 270 /**
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 271 * builtin_driver() - Helper macro for drivers that don't do anything
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 272 * special in init and have no exit. This eliminates some boilerplate.
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 273 * Each driver may only use this macro once, and calling it replaces
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 274 * device_initcall (or in some cases, the legacy __initcall). This is
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 275 * meant to be a direct parallel of module_driver() above but without
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 276 * the __exit stuff that is not used for builtin cases.
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 277 *
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 278 * @__driver: driver name
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 279 * @__register: register function for this driver type
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 280 * @...: Additional arguments to be passed to __register
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 281 *
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 282 * Use this macro to construct bus specific macros for registering
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 283 * drivers, and do not use it on its own.
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 284 */
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 285 #define builtin_driver(__driver, __register, ...) \
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 286 static int __init __driver##_init(void) \
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 287 { \
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 288 return __register(&(__driver) , ##__VA_ARGS__); \
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 289 } \
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 @290 device_initcall(__driver##_init);
4c002c978b7f2f2 Greg Kroah-Hartman 2019-12-09 291
:::::: The code at line 290 was first introduced by commit
:::::: 4c002c978b7f2f2306d53de051c054504af920a9 device.h: move 'struct driver' stuff out to device/driver.h
:::::: TO: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH 06/16] mm/pagemap: Cleanup PREEMPT_COUNT leftovers
by kernel test robot
Hi "Uladzislau,
I love your patch! Yet something to improve:
[auto build test ERROR on arm/for-next]
[also build test ERROR on tip/sched/core linus/master v5.10-rc1]
[cannot apply to rcu/dev drm-intel/for-linux-next next-20201029]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Uladzislau-Rezki-Sony/rcu-tree-A...
base: git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: i386-randconfig-a016-20201029 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/1e0b66ce2b779463194f8b398b8e48caa...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Uladzislau-Rezki-Sony/rcu-tree-Add-a-work-to-allocate-pages-from-regular-context/20201030-005247
git checkout 1e0b66ce2b779463194f8b398b8e48caa95aabf4
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/asm-generic/atomic-instrumented.h:20,
from include/linux/atomic.h:82,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:207:2: note: in expansion of macro 'VM_BUG_ON'
207 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1200: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:185: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +30 include/linux/build_bug.h
527edbc18a70e74 Masahiro Yamada 2019-01-03 18
527edbc18a70e74 Masahiro Yamada 2019-01-03 19 /* Force a compilation error if a constant expression is not a power of 2 */
527edbc18a70e74 Masahiro Yamada 2019-01-03 20 #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \
527edbc18a70e74 Masahiro Yamada 2019-01-03 21 BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
527edbc18a70e74 Masahiro Yamada 2019-01-03 22 #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
527edbc18a70e74 Masahiro Yamada 2019-01-03 23 BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
bc6245e5efd70c4 Ian Abbott 2017-07-10 24
bc6245e5efd70c4 Ian Abbott 2017-07-10 25 /*
bc6245e5efd70c4 Ian Abbott 2017-07-10 26 * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
bc6245e5efd70c4 Ian Abbott 2017-07-10 27 * expression but avoids the generation of any code, even if that expression
bc6245e5efd70c4 Ian Abbott 2017-07-10 28 * has side-effects.
bc6245e5efd70c4 Ian Abbott 2017-07-10 29 */
bc6245e5efd70c4 Ian Abbott 2017-07-10 @30 #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
bc6245e5efd70c4 Ian Abbott 2017-07-10 31
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[hch-block:gendisk-lookup 8/18] drivers/scsi/sd.c:3516:8: warning: variable 'devt' set but not used
by kernel test robot
tree: git://git.infradead.org/users/hch/block.git gendisk-lookup
head: 2aa8840c446b029b28c2bb8ffff9cd0fc9e8ee79
commit: ea8edea6f6084edac13164a86965f501e45bbc3d [8/18] sd: use __register_blkdev to avoid a modprobe for an unregistered dev_t
config: mips-randconfig-r022-20201029 (attached as .config)
compiler: mips64el-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block gendisk-lookup
git checkout ea8edea6f6084edac13164a86965f501e45bbc3d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/scsi/sd.c: In function 'sd_remove':
>> drivers/scsi/sd.c:3516:8: warning: variable 'devt' set but not used [-Wunused-but-set-variable]
3516 | dev_t devt;
| ^~~~
vim +/devt +3516 drivers/scsi/sd.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 3501
^1da177e4c3f415 Linus Torvalds 2005-04-16 3502 /**
^1da177e4c3f415 Linus Torvalds 2005-04-16 3503 * sd_remove - called whenever a scsi disk (previously recognized by
^1da177e4c3f415 Linus Torvalds 2005-04-16 3504 * sd_probe) is detached from the system. It is called (potentially
^1da177e4c3f415 Linus Torvalds 2005-04-16 3505 * multiple times) during sd module unload.
f2a3313d65f0bf6 John Pittman 2017-01-12 3506 * @dev: pointer to device object
^1da177e4c3f415 Linus Torvalds 2005-04-16 3507 *
^1da177e4c3f415 Linus Torvalds 2005-04-16 3508 * Note: this function is invoked from the scsi mid-level.
^1da177e4c3f415 Linus Torvalds 2005-04-16 3509 * This function potentially frees up a device name (e.g. /dev/sdc)
^1da177e4c3f415 Linus Torvalds 2005-04-16 3510 * that could be re-used by a subsequent sd_probe().
^1da177e4c3f415 Linus Torvalds 2005-04-16 3511 * This function is not called when the built-in sd driver is "exit-ed".
^1da177e4c3f415 Linus Torvalds 2005-04-16 3512 **/
^1da177e4c3f415 Linus Torvalds 2005-04-16 3513 static int sd_remove(struct device *dev)
^1da177e4c3f415 Linus Torvalds 2005-04-16 3514 {
601e7638254c118 James Bottomley 2009-05-26 3515 struct scsi_disk *sdkp;
0761df9c4b2d966 Hannes Reinecke 2013-05-10 @3516 dev_t devt;
^1da177e4c3f415 Linus Torvalds 2005-04-16 3517
601e7638254c118 James Bottomley 2009-05-26 3518 sdkp = dev_get_drvdata(dev);
0761df9c4b2d966 Hannes Reinecke 2013-05-10 3519 devt = disk_devt(sdkp->disk);
478a8a054302117 Alan Stern 2010-06-16 3520 scsi_autopm_get_device(sdkp->device);
478a8a054302117 Alan Stern 2010-06-16 3521
3c31b52f96f7b55 Dan Williams 2014-04-10 3522 async_synchronize_full_domain(&scsi_sd_pm_domain);
ee959b00c335d77 Tony Jones 2008-02-22 3523 device_del(&sdkp->dev);
^1da177e4c3f415 Linus Torvalds 2005-04-16 3524 del_gendisk(sdkp->disk);
^1da177e4c3f415 Linus Torvalds 2005-04-16 3525 sd_shutdown(dev);
39b7f1e25a412b0 Alan Stern 2005-11-04 3526
d80210f25ff0050 Christoph Hellwig 2017-06-19 3527 free_opal_dev(sdkp->opal_dev);
d80210f25ff0050 Christoph Hellwig 2017-06-19 3528
0b9506723826c68 Arjan van de Ven 2006-01-11 3529 mutex_lock(&sd_ref_mutex);
39b7f1e25a412b0 Alan Stern 2005-11-04 3530 dev_set_drvdata(dev, NULL);
ee959b00c335d77 Tony Jones 2008-02-22 3531 put_device(&sdkp->dev);
0b9506723826c68 Arjan van de Ven 2006-01-11 3532 mutex_unlock(&sd_ref_mutex);
^1da177e4c3f415 Linus Torvalds 2005-04-16 3533
^1da177e4c3f415 Linus Torvalds 2005-04-16 3534 return 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 3535 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 3536
:::::: The code at line 3516 was first introduced by commit
:::::: 0761df9c4b2d966da3af2ac4ee7372afa681ce63 [SCSI] sd: avoid deadlocks when running under multipath
:::::: TO: Hannes Reinecke <hare(a)suse.de>
:::::: CC: James Bottomley <JBottomley(a)Parallels.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[ti:am6-abi-ti-linux-4.19.y 13126/13162] drivers/pci/controller/pcie-cadence-ep.c:619:33: warning: variable 'vec_ctrl' set but not used
by kernel test robot
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git am6-abi-ti-linux-4.19.y
head: c7a3b610edfb5a0ee0313e1432bf328362269d05
commit: 49d0c5ab68e9f78904a0b582b18300c1e786a0ff [13126/13162] PCI: cadence: Avoid using phys_to_virt() for reading MSI-X table
config: i386-randconfig-a015-20201029 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti am6-abi-ti-linux-4.19.y
git checkout 49d0c5ab68e9f78904a0b582b18300c1e786a0ff
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/pci/controller/pcie-cadence-ep.c: In function 'cdns_pcie_ep_send_msix_irq':
>> drivers/pci/controller/pcie-cadence-ep.c:619:33: warning: variable 'vec_ctrl' set but not used [-Wunused-but-set-variable]
619 | u32 tbl_offset, msg_data, reg, vec_ctrl;
| ^~~~~~~~
vim +/vec_ctrl +619 drivers/pci/controller/pcie-cadence-ep.c
613
614 static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn,
615 u16 interrupt_num)
616 {
617 u32 sriov_cap = CDNS_PCIE_EP_FUNC_SRIOV_CAP_OFFSET;
618 u32 cap = CDNS_PCIE_EP_FUNC_MSIX_CAP_OFFSET;
> 619 u32 tbl_offset, msg_data, reg, vec_ctrl;
620 struct cdns_pcie *pcie = &ep->pcie;
621 struct pci_epf_msix_tbl *msix_tbl;
622 struct pci_epf_bar *epf_bar;
623 u32 first_vf_offset, stride;
624 struct cdns_pcie_epf *epf;
625 u64 pci_addr_mask = 0xff;
626 u64 msg_addr;
627 u16 flags;
628 u8 bir;
629
630 epf = &ep->epf[fn];
631
632 if (vfn > 0) {
633 first_vf_offset = cdns_pcie_ep_fn_readw(pcie, fn, sriov_cap +
634 PCI_SRIOV_VF_OFFSET);
635 stride = cdns_pcie_ep_fn_readw(pcie, fn, sriov_cap +
636 PCI_SRIOV_VF_STRIDE);
637 fn = fn + first_vf_offset + ((vfn - 1) * stride);
638 epf = &epf->epf[vfn - 1];
639 }
640
641 /* Check whether the MSI-X feature has been enabled by the PCI host. */
642 flags = cdns_pcie_ep_fn_readw(pcie, fn, cap + PCI_MSIX_FLAGS);
643 if (!(flags & PCI_MSIX_FLAGS_ENABLE))
644 return -EINVAL;
645
646 reg = cap + PCI_MSIX_TABLE;
647 tbl_offset = cdns_pcie_ep_fn_readl(pcie, fn, reg);
648 bir = tbl_offset & PCI_MSIX_TABLE_BIR;
649 tbl_offset &= PCI_MSIX_TABLE_OFFSET;
650
651 epf_bar = epf->epf_bar[bir];
652 msix_tbl = epf_bar->addr;
653 msix_tbl = (struct pci_epf_msix_tbl *)((char *)msix_tbl + tbl_offset);
654
655 msg_addr = msix_tbl[(interrupt_num - 1)].msg_addr;
656 msg_data = msix_tbl[(interrupt_num - 1)].msg_data;
657 vec_ctrl = msix_tbl[(interrupt_num - 1)].vector_ctrl;
658
659 /* Set the outbound region if needed. */
660 if (unlikely(ep->irq_pci_addr != (msg_addr & ~pci_addr_mask) ||
661 ep->irq_pci_fn != fn)) {
662 /* First region was reserved for IRQ writes. */
663 cdns_pcie_set_outbound_region(pcie, fn, 0,
664 false,
665 ep->irq_phys_addr,
666 msg_addr & ~pci_addr_mask,
667 pci_addr_mask + 1);
668 ep->irq_pci_addr = (msg_addr & ~pci_addr_mask);
669 ep->irq_pci_fn = fn;
670 }
671 writel(msg_data, ep->irq_cpu_addr + (msg_addr & pci_addr_mask));
672
673 return 0;
674 }
675
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[hch-block:gendisk-lookup 10/18] drivers/block/loop.c:2318:16: warning: variable 'range' set but not used
by kernel test robot
tree: git://git.infradead.org/users/hch/block.git gendisk-lookup
head: 2aa8840c446b029b28c2bb8ffff9cd0fc9e8ee79
commit: cec81ebfb622616f62b9d6c5633e05ad9de57f04 [10/18] loop: use __register_blkdev to allocate devices on demand
config: h8300-randconfig-r025-20201029 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block gendisk-lookup
git checkout cec81ebfb622616f62b9d6c5633e05ad9de57f04
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/block/loop.c:52:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/loop.c: In function 'loop_init':
>> drivers/block/loop.c:2318:16: warning: variable 'range' set but not used [-Wunused-but-set-variable]
2318 | unsigned long range;
| ^~~~~
vim +/range +2318 drivers/block/loop.c
770fe30a46a12b6 Kay Sievers 2011-07-31 2314
73285082745045b Ken Chen 2007-05-08 2315 static int __init loop_init(void)
73285082745045b Ken Chen 2007-05-08 2316 {
a47653fc2643cf6 Ken Chen 2007-06-08 2317 int i, nr;
a47653fc2643cf6 Ken Chen 2007-06-08 @2318 unsigned long range;
34dd82afd27da25 Kay Sievers 2011-07-31 2319 struct loop_device *lo;
770fe30a46a12b6 Kay Sievers 2011-07-31 2320 int err;
a47653fc2643cf6 Ken Chen 2007-06-08 2321
476a4813cfddf7c Laurent Vivier 2008-03-26 2322 part_shift = 0;
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2323 if (max_part > 0) {
476a4813cfddf7c Laurent Vivier 2008-03-26 2324 part_shift = fls(max_part);
476a4813cfddf7c Laurent Vivier 2008-03-26 2325
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2326 /*
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2327 * Adjust max_part according to part_shift as it is exported
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2328 * to user space so that user can decide correct minor number
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2329 * if [s]he want to create more devices.
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2330 *
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2331 * Note that -1 is required because partition 0 is reserved
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2332 * for the whole disk.
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2333 */
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2334 max_part = (1UL << part_shift) - 1;
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2335 }
ac04fee0b5c55bb Namhyung Kim 2011-05-27 2336
b1a6650406875b9 Guo Chao 2013-02-21 2337 if ((1UL << part_shift) > DISK_MAX_PARTS) {
b1a6650406875b9 Guo Chao 2013-02-21 2338 err = -EINVAL;
a8c1d064d3e80aa Anton Volkov 2017-08-07 2339 goto err_out;
b1a6650406875b9 Guo Chao 2013-02-21 2340 }
78f4bb367fd147a Namhyung Kim 2011-05-24 2341
b1a6650406875b9 Guo Chao 2013-02-21 2342 if (max_loop > 1UL << (MINORBITS - part_shift)) {
b1a6650406875b9 Guo Chao 2013-02-21 2343 err = -EINVAL;
a8c1d064d3e80aa Anton Volkov 2017-08-07 2344 goto err_out;
b1a6650406875b9 Guo Chao 2013-02-21 2345 }
73285082745045b Ken Chen 2007-05-08 2346
d134b00b9acca3f Kay Sievers 2011-07-31 2347 /*
d134b00b9acca3f Kay Sievers 2011-07-31 2348 * If max_loop is specified, create that many devices upfront.
d134b00b9acca3f Kay Sievers 2011-07-31 2349 * This also becomes a hard limit. If max_loop is not specified,
d134b00b9acca3f Kay Sievers 2011-07-31 2350 * create CONFIG_BLK_DEV_LOOP_MIN_COUNT loop devices at module
d134b00b9acca3f Kay Sievers 2011-07-31 2351 * init time. Loop devices can be requested on-demand with the
d134b00b9acca3f Kay Sievers 2011-07-31 2352 * /dev/loop-control interface, or be instantiated by accessing
d134b00b9acca3f Kay Sievers 2011-07-31 2353 * a 'dead' device node.
d134b00b9acca3f Kay Sievers 2011-07-31 2354 */
73285082745045b Ken Chen 2007-05-08 2355 if (max_loop) {
a47653fc2643cf6 Ken Chen 2007-06-08 2356 nr = max_loop;
a1c15c59feee362 Namhyung Kim 2011-05-24 2357 range = max_loop << part_shift;
a47653fc2643cf6 Ken Chen 2007-06-08 2358 } else {
d134b00b9acca3f Kay Sievers 2011-07-31 2359 nr = CONFIG_BLK_DEV_LOOP_MIN_COUNT;
a1c15c59feee362 Namhyung Kim 2011-05-24 2360 range = 1UL << MINORBITS;
a47653fc2643cf6 Ken Chen 2007-06-08 2361 }
a47653fc2643cf6 Ken Chen 2007-06-08 2362
a8c1d064d3e80aa Anton Volkov 2017-08-07 2363 err = misc_register(&loop_misc);
a8c1d064d3e80aa Anton Volkov 2017-08-07 2364 if (err < 0)
a8c1d064d3e80aa Anton Volkov 2017-08-07 2365 goto err_out;
a8c1d064d3e80aa Anton Volkov 2017-08-07 2366
a8c1d064d3e80aa Anton Volkov 2017-08-07 2367
cec81ebfb622616 Christoph Hellwig 2020-08-23 2368 if (__register_blkdev(LOOP_MAJOR, "loop", loop_probe)) {
b1a6650406875b9 Guo Chao 2013-02-21 2369 err = -EIO;
b1a6650406875b9 Guo Chao 2013-02-21 2370 goto misc_out;
b1a6650406875b9 Guo Chao 2013-02-21 2371 }
73285082745045b Ken Chen 2007-05-08 2372
d134b00b9acca3f Kay Sievers 2011-07-31 2373 /* pre-create number of devices given by config or max_loop */
0a42e99b58a2088 Jan Kara 2018-11-08 2374 mutex_lock(&loop_ctl_mutex);
34dd82afd27da25 Kay Sievers 2011-07-31 2375 for (i = 0; i < nr; i++)
34dd82afd27da25 Kay Sievers 2011-07-31 2376 loop_add(&lo, i);
0a42e99b58a2088 Jan Kara 2018-11-08 2377 mutex_unlock(&loop_ctl_mutex);
34dd82afd27da25 Kay Sievers 2011-07-31 2378
73285082745045b Ken Chen 2007-05-08 2379 printk(KERN_INFO "loop: module loaded\n");
^1da177e4c3f415 Linus Torvalds 2005-04-16 2380 return 0;
b1a6650406875b9 Guo Chao 2013-02-21 2381
b1a6650406875b9 Guo Chao 2013-02-21 2382 misc_out:
b1a6650406875b9 Guo Chao 2013-02-21 2383 misc_deregister(&loop_misc);
a8c1d064d3e80aa Anton Volkov 2017-08-07 2384 err_out:
b1a6650406875b9 Guo Chao 2013-02-21 2385 return err;
34dd82afd27da25 Kay Sievers 2011-07-31 2386 }
a47653fc2643cf6 Ken Chen 2007-06-08 2387
:::::: The code at line 2318 was first introduced by commit
:::::: a47653fc2643cf61bcabba8c9ff5c45517c089ba loop: preallocate eight loop devices
:::::: TO: Ken Chen <kenchen(a)google.com>
:::::: CC: Linus Torvalds <torvalds(a)woody.linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
arch/powerpc/lib/sstep.c:1172:21: error: variable 'suffix' set but not used
by kernel test robot
Hi Jordan,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 23859ae44402f4d935b9ee548135dd1e65e2cbf4
commit: 650b55b707fdfa764e9f2b81314d3eb4216fb962 powerpc: Add prefixed instructions to instruction data type
date: 5 months ago
config: powerpc-allnoconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 650b55b707fdfa764e9f2b81314d3eb4216fb962
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/powerpc/lib/sstep.c: In function 'analyse_instr':
>> arch/powerpc/lib/sstep.c:1172:21: error: variable 'suffix' set but not used [-Werror=unused-but-set-variable]
1172 | unsigned int word, suffix;
| ^~~~~~
arch/powerpc/lib/sstep.c:1168:31: error: variable 'rc' set but not used [-Werror=unused-but-set-variable]
1168 | unsigned int opcode, ra, rb, rc, rd, spr, u;
| ^~
cc1: all warnings being treated as errors
vim +/suffix +1172 arch/powerpc/lib/sstep.c
1153
1154 /*
1155 * Decode an instruction, and return information about it in *op
1156 * without changing *regs.
1157 * Integer arithmetic and logical instructions, branches, and barrier
1158 * instructions can be emulated just using the information in *op.
1159 *
1160 * Return value is 1 if the instruction can be emulated just by
1161 * updating *regs with the information in *op, -1 if we need the
1162 * GPRs but *regs doesn't contain the full register set, or 0
1163 * otherwise.
1164 */
1165 int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
1166 struct ppc_inst instr)
1167 {
1168 unsigned int opcode, ra, rb, rc, rd, spr, u;
1169 unsigned long int imm;
1170 unsigned long int val, val2;
1171 unsigned int mb, me, sh;
> 1172 unsigned int word, suffix;
1173 long ival;
1174
1175 word = ppc_inst_val(instr);
1176 suffix = ppc_inst_suffix(instr);
1177
1178 op->type = COMPUTE;
1179
1180 opcode = ppc_inst_primary_opcode(instr);
1181 switch (opcode) {
1182 case 16: /* bc */
1183 op->type = BRANCH;
1184 imm = (signed short)(word & 0xfffc);
1185 if ((word & 2) == 0)
1186 imm += regs->nip;
1187 op->val = truncate_if_32bit(regs->msr, imm);
1188 if (word & 1)
1189 op->type |= SETLK;
1190 if (branch_taken(word, regs, op))
1191 op->type |= BRTAKEN;
1192 return 1;
1193 #ifdef CONFIG_PPC64
1194 case 17: /* sc */
1195 if ((word & 0xfe2) == 2)
1196 op->type = SYSCALL;
1197 else
1198 op->type = UNKNOWN;
1199 return 0;
1200 #endif
1201 case 18: /* b */
1202 op->type = BRANCH | BRTAKEN;
1203 imm = word & 0x03fffffc;
1204 if (imm & 0x02000000)
1205 imm -= 0x04000000;
1206 if ((word & 2) == 0)
1207 imm += regs->nip;
1208 op->val = truncate_if_32bit(regs->msr, imm);
1209 if (word & 1)
1210 op->type |= SETLK;
1211 return 1;
1212 case 19:
1213 switch ((word >> 1) & 0x3ff) {
1214 case 0: /* mcrf */
1215 op->type = COMPUTE + SETCC;
1216 rd = 7 - ((word >> 23) & 0x7);
1217 ra = 7 - ((word >> 18) & 0x7);
1218 rd *= 4;
1219 ra *= 4;
1220 val = (regs->ccr >> ra) & 0xf;
1221 op->ccval = (regs->ccr & ~(0xfUL << rd)) | (val << rd);
1222 return 1;
1223
1224 case 16: /* bclr */
1225 case 528: /* bcctr */
1226 op->type = BRANCH;
1227 imm = (word & 0x400)? regs->ctr: regs->link;
1228 op->val = truncate_if_32bit(regs->msr, imm);
1229 if (word & 1)
1230 op->type |= SETLK;
1231 if (branch_taken(word, regs, op))
1232 op->type |= BRTAKEN;
1233 return 1;
1234
1235 case 18: /* rfid, scary */
1236 if (regs->msr & MSR_PR)
1237 goto priv;
1238 op->type = RFI;
1239 return 0;
1240
1241 case 150: /* isync */
1242 op->type = BARRIER | BARRIER_ISYNC;
1243 return 1;
1244
1245 case 33: /* crnor */
1246 case 129: /* crandc */
1247 case 193: /* crxor */
1248 case 225: /* crnand */
1249 case 257: /* crand */
1250 case 289: /* creqv */
1251 case 417: /* crorc */
1252 case 449: /* cror */
1253 op->type = COMPUTE + SETCC;
1254 ra = (word >> 16) & 0x1f;
1255 rb = (word >> 11) & 0x1f;
1256 rd = (word >> 21) & 0x1f;
1257 ra = (regs->ccr >> (31 - ra)) & 1;
1258 rb = (regs->ccr >> (31 - rb)) & 1;
1259 val = (word >> (6 + ra * 2 + rb)) & 1;
1260 op->ccval = (regs->ccr & ~(1UL << (31 - rd))) |
1261 (val << (31 - rd));
1262 return 1;
1263 }
1264 break;
1265 case 31:
1266 switch ((word >> 1) & 0x3ff) {
1267 case 598: /* sync */
1268 op->type = BARRIER + BARRIER_SYNC;
1269 #ifdef __powerpc64__
1270 switch ((word >> 21) & 3) {
1271 case 1: /* lwsync */
1272 op->type = BARRIER + BARRIER_LWSYNC;
1273 break;
1274 case 2: /* ptesync */
1275 op->type = BARRIER + BARRIER_PTESYNC;
1276 break;
1277 }
1278 #endif
1279 return 1;
1280
1281 case 854: /* eieio */
1282 op->type = BARRIER + BARRIER_EIEIO;
1283 return 1;
1284 }
1285 break;
1286 }
1287
1288 /* Following cases refer to regs->gpr[], so we need all regs */
1289 if (!FULL_REGS(regs))
1290 return -1;
1291
1292 rd = (word >> 21) & 0x1f;
1293 ra = (word >> 16) & 0x1f;
1294 rb = (word >> 11) & 0x1f;
1295 rc = (word >> 6) & 0x1f;
1296
1297 switch (opcode) {
1298 #ifdef __powerpc64__
1299 case 2: /* tdi */
1300 if (rd & trap_compare(regs->gpr[ra], (short) word))
1301 goto trap;
1302 return 1;
1303 #endif
1304 case 3: /* twi */
1305 if (rd & trap_compare((int)regs->gpr[ra], (short) word))
1306 goto trap;
1307 return 1;
1308
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[jolsa-perf:rostedt_ftrace/core 1/3] fs/pstore/ftrace.c:61:10: error: initialization of 'void unsigned int, long unsigned int, struct ftrace_ops struct ftrace_regs from incompatible pointer type 'void unsigned int, long unsigned int, struct ftrace_ops struct p...
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git rostedt_ftrace/core
head: 4c704bce795d69a9db9d2d21d11612bc78b3e54a
commit: 2c1eb4b14715ba8e6bd2b00f1523c881920a2256 [1/3] ftrace: Have the callbacks receive a struct ftrace_regs instead of pt_regs
config: i386-randconfig-a016-20201029 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id...
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf rostedt_ftrace/core
git checkout 2c1eb4b14715ba8e6bd2b00f1523c881920a2256
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> fs/pstore/ftrace.c:61:10: error: initialization of 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *)' from incompatible pointer type 'void (*)(long unsigned int, long unsigned int, struct ftrace_ops *, struct pt_regs *)' [-Werror=incompatible-pointer-types]
61 | .func = pstore_ftrace_call,
| ^~~~~~~~~~~~~~~~~~
fs/pstore/ftrace.c:61:10: note: (near initialization for 'pstore_ftrace_ops.func')
cc1: some warnings being treated as errors
vim +61 fs/pstore/ftrace.c
65f8c95e46a1827 Anton Vorontsov 2012-07-17 59
65f8c95e46a1827 Anton Vorontsov 2012-07-17 60 static struct ftrace_ops pstore_ftrace_ops __read_mostly = {
65f8c95e46a1827 Anton Vorontsov 2012-07-17 @61 .func = pstore_ftrace_call,
65f8c95e46a1827 Anton Vorontsov 2012-07-17 62 };
65f8c95e46a1827 Anton Vorontsov 2012-07-17 63
:::::: The code at line 61 was first introduced by commit
:::::: 65f8c95e46a1827ae8bbc52a817ea308dd7d65ae pstore/ftrace: Convert to its own enable/disable debugfs knob
:::::: TO: Anton Vorontsov <anton.vorontsov(a)linaro.org>
:::::: CC: Anton Vorontsov <anton.vorontsov(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months