From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [asahilinux:asc/dev 6/6] drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'}
Date: Fri, 30 Jul 2021 07:36:20 +0800 [thread overview]
Message-ID: <202107300714.fpE9Im8b-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 18100 bytes --]
tree: https://github.com/AsahiLinux/linux asc/dev
head: 907486d12637dc27e339f7084dc78aeaf323479f
commit: 907486d12637dc27e339f7084dc78aeaf323479f [6/6] mailbox WIP
config: i386-allyesconfig (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
# https://github.com/AsahiLinux/linux/commit/907486d12637dc27e339f7084dc78aeaf323479f
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux asc/dev
git checkout 907486d12637dc27e339f7084dc78aeaf323479f
# 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@intel.com>
All warnings (new ones prefixed by >>):
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
54 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:17: note: in expansion of macro 'FIELD_GET'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
54 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:55:21: note: in expansion of macro '__bf_shf'
55 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:17: note: in expansion of macro 'FIELD_GET'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/mailbox/apple-asc-mailbox.h:4,
from drivers/mailbox/apple-asc-mailbox.c:3:
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bitfield.h:109:30: note: in definition of macro 'FIELD_GET'
109 | (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
| ^~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bitfield.h:42:38: note: in definition of macro '__bf_shf'
42 | #define __bf_shf(x) (__builtin_ffsll(x) - 1)
| ^
drivers/mailbox/apple-asc-mailbox.c:242:17: note: in expansion of macro 'FIELD_GET'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/mailbox/apple-asc-mailbox.h:9,
from drivers/mailbox/apple-asc-mailbox.c:3:
>> drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/mailbox/apple-asc-mailbox.c:256:3: note: in expansion of macro 'dev_warn'
256 | dev_warn(
| ^~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:258:60: note: format string is defined here
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/mailbox/apple-asc-mailbox.h:9,
from drivers/mailbox/apple-asc-mailbox.c:3:
>> drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/mailbox/apple-asc-mailbox.c:256:3: note: in expansion of macro 'dev_warn'
256 | dev_warn(
| ^~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:258:100: note: format string is defined here
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/mailbox/apple-asc-mailbox.h:9,
from drivers/mailbox/apple-asc-mailbox.c:3:
drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/mailbox/apple-asc-mailbox.c:256:3: note: in expansion of macro 'dev_warn'
256 | dev_warn(
| ^~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:258:109: note: format string is defined here
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ~~~^
| |
| long long unsigned int
| %x
In file included from <command-line>:
drivers/mailbox/apple-asc-mailbox.c: In function '__shmem_dma_handle_request':
include/linux/bits.h:35:22: warning: left shift count >= width of type [-Wshift-count-overflow]
35 | (((~UL(0)) - (UL(1) << (l)) + 1) & \
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:17: note: in expansion of macro 'FIELD_GET'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:83:41: note: in expansion of macro 'GENMASK'
83 | #define APPLE_RTKIT_BUFFER_REQUEST_SIZE GENMASK(51, 44)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_SIZE'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:17: note: in expansion of macro 'FIELD_GET'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:83:41: note: in expansion of macro 'GENMASK'
83 | #define APPLE_RTKIT_BUFFER_REQUEST_SIZE GENMASK(51, 44)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_SIZE'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:35:22: warning: left shift count >= width of type [-Wshift-count-overflow]
35 | (((~UL(0)) - (UL(1) << (l)) + 1) & \
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
vim +258 drivers/mailbox/apple-asc-mailbox.c
236
237 static void shmem_iobuf_handle_request(struct apple_mbox *apple_mbox,
238 struct mbox_chan *chan, u64 msg,
239 struct apple_mbox_shared_memory *buffer)
240 {
241 buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
242 buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
243
244 if (WARN_ON(!apple_mbox->mmio_shmem))
245 goto error;
246
247 /*
248 * these are always bugs (or a rogue coprocessor firmware) and we can't
249 * do anything here to recover. this endpoint just won't work.
250 * (e.g. we won't get syslog messages or can't read crashlogs)
251 */
252 if (buffer->iova < apple_mbox->mmio_shmem->start ||
253 buffer->iova > apple_mbox->mmio_shmem->end ||
254 buffer->iova + buffer->size < apple_mbox->mmio_shmem->start ||
255 buffer->iova + buffer->size > apple_mbox->mmio_shmem->end) {
256 dev_warn(
257 apple_mbox->dev,
> 258 "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
259 buffer->size, buffer->iova,
260 apple_mbox->mmio_shmem->start,
261 apple_mbox->mmio_shmem->end);
262 goto error;
263 }
264
265 buffer->iomem =
266 devm_ioremap_np(apple_mbox->dev, buffer->iova, buffer->size);
267 return;
268
269 error:
270 buffer->size = 0;
271 buffer->iova = 0;
272 }
273
---
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: 65181 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Sven Peter <sven@svenpeter.dev>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [asahilinux:asc/dev 6/6] drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'}
Date: Fri, 30 Jul 2021 07:36:20 +0800 [thread overview]
Message-ID: <202107300714.fpE9Im8b-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 17814 bytes --]
tree: https://github.com/AsahiLinux/linux asc/dev
head: 907486d12637dc27e339f7084dc78aeaf323479f
commit: 907486d12637dc27e339f7084dc78aeaf323479f [6/6] mailbox WIP
config: i386-allyesconfig (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
# https://github.com/AsahiLinux/linux/commit/907486d12637dc27e339f7084dc78aeaf323479f
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux asc/dev
git checkout 907486d12637dc27e339f7084dc78aeaf323479f
# 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@intel.com>
All warnings (new ones prefixed by >>):
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
54 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:17: note: in expansion of macro 'FIELD_GET'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
54 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:55:21: note: in expansion of macro '__bf_shf'
55 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:17: note: in expansion of macro 'FIELD_GET'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/mailbox/apple-asc-mailbox.h:4,
from drivers/mailbox/apple-asc-mailbox.c:3:
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bitfield.h:109:30: note: in definition of macro 'FIELD_GET'
109 | (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
| ^~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bitfield.h:42:38: note: in definition of macro '__bf_shf'
42 | #define __bf_shf(x) (__builtin_ffsll(x) - 1)
| ^
drivers/mailbox/apple-asc-mailbox.c:242:17: note: in expansion of macro 'FIELD_GET'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:84:41: note: in expansion of macro 'GENMASK'
84 | #define APPLE_RTKIT_BUFFER_REQUEST_IOVA GENMASK(39, 0)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:242:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_IOVA'
242 | buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/mailbox/apple-asc-mailbox.h:9,
from drivers/mailbox/apple-asc-mailbox.c:3:
>> drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/mailbox/apple-asc-mailbox.c:256:3: note: in expansion of macro 'dev_warn'
256 | dev_warn(
| ^~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:258:60: note: format string is defined here
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/mailbox/apple-asc-mailbox.h:9,
from drivers/mailbox/apple-asc-mailbox.c:3:
>> drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/mailbox/apple-asc-mailbox.c:256:3: note: in expansion of macro 'dev_warn'
256 | dev_warn(
| ^~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:258:100: note: format string is defined here
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/mailbox/apple-asc-mailbox.h:9,
from drivers/mailbox/apple-asc-mailbox.c:3:
drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/mailbox/apple-asc-mailbox.c:256:3: note: in expansion of macro 'dev_warn'
256 | dev_warn(
| ^~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:258:109: note: format string is defined here
258 | "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
| ~~~^
| |
| long long unsigned int
| %x
In file included from <command-line>:
drivers/mailbox/apple-asc-mailbox.c: In function '__shmem_dma_handle_request':
include/linux/bits.h:35:22: warning: left shift count >= width of type [-Wshift-count-overflow]
35 | (((~UL(0)) - (UL(1) << (l)) + 1) & \
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:17: note: in expansion of macro 'FIELD_GET'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:83:41: note: in expansion of macro 'GENMASK'
83 | #define APPLE_RTKIT_BUFFER_REQUEST_SIZE GENMASK(51, 44)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_SIZE'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:36:11: warning: right shift count is negative [-Wshift-count-negative]
36 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert'
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:108:3: note: in expansion of macro '__BF_FIELD_CHECK'
108 | __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:17: note: in expansion of macro 'FIELD_GET'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~
include/linux/bits.h:38:31: note: in expansion of macro '__GENMASK'
38 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/mailbox/apple-asc-mailbox.h:83:41: note: in expansion of macro 'GENMASK'
83 | #define APPLE_RTKIT_BUFFER_REQUEST_SIZE GENMASK(51, 44)
| ^~~~~~~
drivers/mailbox/apple-asc-mailbox.c:278:27: note: in expansion of macro 'APPLE_RTKIT_BUFFER_REQUEST_SIZE'
278 | buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:35:22: warning: left shift count >= width of type [-Wshift-count-overflow]
35 | (((~UL(0)) - (UL(1) << (l)) + 1) & \
| ^~
include/linux/compiler_types.h:308:9: note: in definition of macro '__compiletime_assert'
308 | if (!(condition)) \
vim +258 drivers/mailbox/apple-asc-mailbox.c
236
237 static void shmem_iobuf_handle_request(struct apple_mbox *apple_mbox,
238 struct mbox_chan *chan, u64 msg,
239 struct apple_mbox_shared_memory *buffer)
240 {
241 buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
242 buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
243
244 if (WARN_ON(!apple_mbox->mmio_shmem))
245 goto error;
246
247 /*
248 * these are always bugs (or a rogue coprocessor firmware) and we can't
249 * do anything here to recover. this endpoint just won't work.
250 * (e.g. we won't get syslog messages or can't read crashlogs)
251 */
252 if (buffer->iova < apple_mbox->mmio_shmem->start ||
253 buffer->iova > apple_mbox->mmio_shmem->end ||
254 buffer->iova + buffer->size < apple_mbox->mmio_shmem->start ||
255 buffer->iova + buffer->size > apple_mbox->mmio_shmem->end) {
256 dev_warn(
257 apple_mbox->dev,
> 258 "coprocessor sent shmem buffer with 0x%zx bytes at 0x%llx outside of the configured region 0x%llx...0x%llx",
259 buffer->size, buffer->iova,
260 apple_mbox->mmio_shmem->start,
261 apple_mbox->mmio_shmem->end);
262 goto error;
263 }
264
265 buffer->iomem =
266 devm_ioremap_np(apple_mbox->dev, buffer->iova, buffer->size);
267 return;
268
269 error:
270 buffer->size = 0;
271 buffer->iova = 0;
272 }
273
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65181 bytes --]
next reply other threads:[~2021-07-29 23:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 23:36 kernel test robot [this message]
2021-07-29 23:36 ` [asahilinux:asc/dev 6/6] drivers/mailbox/apple-asc-mailbox.c:258:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202107300714.fpE9Im8b-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.