Re: [PATCH 10/11] serial: make uart_console_write->putchar()'s character a char
by kernel test robot
Hi Jiri,
I love your patch! Yet something to improve:
[auto build test ERROR on tty/tty-testing]
[also build test ERROR on v5.17-rc1 next-20220124]
[cannot apply to shawnguo/for-next davem-sparc/master]
[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/Jiri-Slaby/TTY-patches-for-5-18/...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: arc-randconfig-r043-20220124 (https://download.01.org/0day-ci/archive/20220125/202201250004.SHBbOjs3-lk...)
compiler: arc-elf-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/45520d4f6db241db0b77f41162adba4a9...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiri-Slaby/TTY-patches-for-5-18/20220124-151758
git checkout 45520d4f6db241db0b77f41162adba4a9977956c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/tty/serial/
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 >>):
drivers/tty/serial/omap-serial.c: In function 'serial_omap_console_write':
>> drivers/tty/serial/omap-serial.c:1272:49: error: passing argument 4 of 'uart_console_write' from incompatible pointer type [-Werror=incompatible-pointer-types]
1272 | uart_console_write(&up->port, s, count, serial_omap_console_putchar);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(struct uart_port *, int)
In file included from drivers/tty/serial/omap-serial.c:30:
include/linux/serial_core.h:402:32: note: expected 'void (*)(struct uart_port *, char)' but argument is of type 'void (*)(struct uart_port *, int)'
402 | void (*putchar)(struct uart_port *, char));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/uart_console_write +1272 drivers/tty/serial/omap-serial.c
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1248
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1249 static void
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1250 serial_omap_console_write(struct console *co, const char *s,
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1251 unsigned int count)
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1252 {
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1253 struct uart_omap_port *up = serial_omap_console_ports[co->index];
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1254 unsigned long flags;
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1255 unsigned int ier;
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1256 int locked = 1;
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1257
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1258 local_irq_save(flags);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1259 if (up->port.sysrq)
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1260 locked = 0;
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1261 else if (oops_in_progress)
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1262 locked = spin_trylock(&up->port.lock);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1263 else
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1264 spin_lock(&up->port.lock);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1265
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1266 /*
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1267 * First save the IER then disable the interrupts
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1268 */
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1269 ier = serial_in(up, UART_IER);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1270 serial_out(up, UART_IER, 0);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1271
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 @1272 uart_console_write(&up->port, s, count, serial_omap_console_putchar);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1273
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1274 /*
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1275 * Finally, wait for transmitter to become empty
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1276 * and restore the IER
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1277 */
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1278 wait_for_xmitr(up);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1279 serial_out(up, UART_IER, ier);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1280 /*
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1281 * The receive handling will happen properly because the
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1282 * receive ready bit will still be set; it is not cleared
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1283 * on read. However, modem control will not, we must
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1284 * call it if we have saved something in the saved flags
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1285 * while processing with interrupts off.
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1286 */
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1287 if (up->msr_saved_flags)
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1288 check_modem_status(up);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1289
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1290 if (locked)
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1291 spin_unlock(&up->port.lock);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1292 local_irq_restore(flags);
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1293 }
b612633b592807 drivers/serial/omap-serial.c Govindraj.R 2010-09-27 1294
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH 3/3] io_uring: zerocopy receive
by kernel test robot
Hi Hao,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.17-rc1 next-20220124]
[cannot apply to horms-ipvs/master]
[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/Hao-Xu/io_uring-zerocopy-receive...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
config: h8300-randconfig-r026-20220124 (https://download.01.org/0day-ci/archive/20220124/202201242307.INcQOwqz-lk...)
compiler: h8300-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/295704165d394635876364522d3ac1451...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hao-Xu/io_uring-zerocopy-receive/20220124-174546
git checkout 295704165d394635876364522d3ac1451b62da66
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash
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/kernel.h:20,
from fs/io_uring.c:42:
include/linux/scatterlist.h: In function 'sg_set_buf':
include/asm-generic/page.h:89:51: warning: ordered comparison of pointer with null pointer [-Wextra]
89 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:160:9: note: in expansion of macro 'BUG_ON'
160 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:160:17: note: in expansion of macro 'virt_addr_valid'
160 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
fs/io_uring.c: In function '__io_submit_flush_completions':
fs/io_uring.c:2537:40: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
2537 | struct io_wq_work_node *node, *prev;
| ^~~~
fs/io_uring.c: In function 'io_req_prep':
>> fs/io_uring.c:6639:24: error: implicit declaration of function 'io_recvzc_prep'; did you mean 'io_recvmsg_prep'? [-Werror=implicit-function-declaration]
6639 | return io_recvzc_prep(req, sqe);
| ^~~~~~~~~~~~~~
| io_recvmsg_prep
fs/io_uring.c: In function 'io_issue_sqe':
>> fs/io_uring.c:6924:23: error: implicit declaration of function 'io_recvzc'; did you mean 'io_recv'? [-Werror=implicit-function-declaration]
6924 | ret = io_recvzc(req, issue_flags);
| ^~~~~~~~~
| io_recv
cc1: some warnings being treated as errors
vim +6639 fs/io_uring.c
6560
6561 static int io_req_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
6562 {
6563 switch (req->opcode) {
6564 case IORING_OP_NOP:
6565 return 0;
6566 case IORING_OP_READV:
6567 case IORING_OP_READ_FIXED:
6568 case IORING_OP_READ:
6569 return io_read_prep(req, sqe);
6570 case IORING_OP_WRITEV:
6571 case IORING_OP_WRITE_FIXED:
6572 case IORING_OP_WRITE:
6573 return io_write_prep(req, sqe);
6574 case IORING_OP_POLL_ADD:
6575 return io_poll_add_prep(req, sqe);
6576 case IORING_OP_POLL_REMOVE:
6577 return io_poll_update_prep(req, sqe);
6578 case IORING_OP_FSYNC:
6579 return io_fsync_prep(req, sqe);
6580 case IORING_OP_SYNC_FILE_RANGE:
6581 return io_sfr_prep(req, sqe);
6582 case IORING_OP_SENDMSG:
6583 case IORING_OP_SEND:
6584 return io_sendmsg_prep(req, sqe);
6585 case IORING_OP_RECVMSG:
6586 case IORING_OP_RECV:
6587 return io_recvmsg_prep(req, sqe);
6588 case IORING_OP_CONNECT:
6589 return io_connect_prep(req, sqe);
6590 case IORING_OP_TIMEOUT:
6591 return io_timeout_prep(req, sqe, false);
6592 case IORING_OP_TIMEOUT_REMOVE:
6593 return io_timeout_remove_prep(req, sqe);
6594 case IORING_OP_ASYNC_CANCEL:
6595 return io_async_cancel_prep(req, sqe);
6596 case IORING_OP_LINK_TIMEOUT:
6597 return io_timeout_prep(req, sqe, true);
6598 case IORING_OP_ACCEPT:
6599 return io_accept_prep(req, sqe);
6600 case IORING_OP_FALLOCATE:
6601 return io_fallocate_prep(req, sqe);
6602 case IORING_OP_OPENAT:
6603 return io_openat_prep(req, sqe);
6604 case IORING_OP_CLOSE:
6605 return io_close_prep(req, sqe);
6606 case IORING_OP_FILES_UPDATE:
6607 return io_rsrc_update_prep(req, sqe);
6608 case IORING_OP_STATX:
6609 return io_statx_prep(req, sqe);
6610 case IORING_OP_FADVISE:
6611 return io_fadvise_prep(req, sqe);
6612 case IORING_OP_MADVISE:
6613 return io_madvise_prep(req, sqe);
6614 case IORING_OP_OPENAT2:
6615 return io_openat2_prep(req, sqe);
6616 case IORING_OP_EPOLL_CTL:
6617 return io_epoll_ctl_prep(req, sqe);
6618 case IORING_OP_SPLICE:
6619 return io_splice_prep(req, sqe);
6620 case IORING_OP_PROVIDE_BUFFERS:
6621 return io_provide_buffers_prep(req, sqe);
6622 case IORING_OP_REMOVE_BUFFERS:
6623 return io_remove_buffers_prep(req, sqe);
6624 case IORING_OP_TEE:
6625 return io_tee_prep(req, sqe);
6626 case IORING_OP_SHUTDOWN:
6627 return io_shutdown_prep(req, sqe);
6628 case IORING_OP_RENAMEAT:
6629 return io_renameat_prep(req, sqe);
6630 case IORING_OP_UNLINKAT:
6631 return io_unlinkat_prep(req, sqe);
6632 case IORING_OP_MKDIRAT:
6633 return io_mkdirat_prep(req, sqe);
6634 case IORING_OP_SYMLINKAT:
6635 return io_symlinkat_prep(req, sqe);
6636 case IORING_OP_LINKAT:
6637 return io_linkat_prep(req, sqe);
6638 case IORING_OP_RECVZC:
> 6639 return io_recvzc_prep(req, sqe);
6640 }
6641
6642 printk_once(KERN_WARNING "io_uring: unhandled opcode %d\n",
6643 req->opcode);
6644 return -EINVAL;
6645 }
6646
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
arch/mips/kernel/relocate.c:41:12: warning: no previous prototype for function 'plat_post_relocation'
by kernel test robot
Hi Jinyang,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: a307a4ce9ecd2e23c71318201330d9d648b3f818 MIPS: Loongson64: Add KASLR support
date: 1 year, 2 months ago
config: mips-randconfig-c004-20220120 (https://download.01.org/0day-ci/archive/20220124/202201242332.W7XuI6gI-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f7b7138a62648f4019c55e4671682af1f851f295)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# 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 a307a4ce9ecd2e23c71318201330d9d648b3f818
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash 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 >>):
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:257:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic, int, subu, ll, sc)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from arch/mips/kernel/relocate.c:12:
In file included from arch/mips/include/asm/cacheflush.h:13:
In file included from include/linux/mm.h:10:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:261:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic64, s64, dsubu, lld, scd)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from arch/mips/kernel/relocate.c:12:
In file included from arch/mips/include/asm/cacheflush.h:13:
In file included from include/linux/mm.h:10:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:15:
In file included from include/linux/smp_types.h:5:
include/linux/llist.h:222:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&head->first, NULL);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from arch/mips/kernel/relocate.c:12:
In file included from arch/mips/include/asm/cacheflush.h:13:
In file included from include/linux/mm.h:10:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:27:
include/linux/debug_locks.h:17:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&debug_locks, 0);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from arch/mips/kernel/relocate.c:12:
In file included from arch/mips/include/asm/cacheflush.h:13:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
arch/mips/include/asm/pgtable.h:200:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
cmpxchg64(&buddy->pte, 0, _PAGE_GLOBAL);
^
arch/mips/include/asm/cmpxchg.h:220:2: note: expanded from macro 'cmpxchg64'
cmpxchg((ptr), (o), (n)); \
^
arch/mips/include/asm/cmpxchg.h:194:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from arch/mips/kernel/relocate.c:12:
In file included from arch/mips/include/asm/cacheflush.h:13:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
arch/mips/include/asm/pgtable.h:200:3: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
arch/mips/include/asm/cmpxchg.h:220:2: note: expanded from macro 'cmpxchg64'
cmpxchg((ptr), (o), (n)); \
^
arch/mips/include/asm/cmpxchg.h:204:7: note: expanded from macro 'cmpxchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
>> arch/mips/kernel/relocate.c:41:12: warning: no previous prototype for function 'plat_post_relocation' [-Wmissing-prototypes]
int __weak plat_post_relocation(long offset)
^
arch/mips/kernel/relocate.c:41:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __weak plat_post_relocation(long offset)
^
static
arch/mips/kernel/relocate.c:135:12: warning: no previous prototype for function 'do_relocations' [-Wmissing-prototypes]
int __init do_relocations(void *kbase_old, void *kbase_new, long offset)
^
arch/mips/kernel/relocate.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __init do_relocations(void *kbase_old, void *kbase_new, long offset)
^
static
>> arch/mips/kernel/relocate.c:304:14: warning: no previous prototype for function 'relocate_kernel' [-Wmissing-prototypes]
void *__init relocate_kernel(void)
^
arch/mips/kernel/relocate.c:304:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void *__init relocate_kernel(void)
^
static
arch/mips/kernel/relocate.c:415:6: warning: no previous prototype for function 'show_kernel_relocation' [-Wmissing-prototypes]
void show_kernel_relocation(const char *level)
^
arch/mips/kernel/relocate.c:415:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void show_kernel_relocation(const char *level)
^
static
16 warnings generated.
vim +/plat_post_relocation +41 arch/mips/kernel/relocate.c
4c9fff362261d6 Marcin Nowakowski 2016-11-23 35
8cc709d7d4f013 Steven J. Hill 2016-12-09 36 /*
8cc709d7d4f013 Steven J. Hill 2016-12-09 37 * This function may be defined for a platform to perform any post-relocation
8cc709d7d4f013 Steven J. Hill 2016-12-09 38 * fixup necessary.
8cc709d7d4f013 Steven J. Hill 2016-12-09 39 * Return non-zero to abort relocation
8cc709d7d4f013 Steven J. Hill 2016-12-09 40 */
8cc709d7d4f013 Steven J. Hill 2016-12-09 @41 int __weak plat_post_relocation(long offset)
8cc709d7d4f013 Steven J. Hill 2016-12-09 42 {
8cc709d7d4f013 Steven J. Hill 2016-12-09 43 return 0;
8cc709d7d4f013 Steven J. Hill 2016-12-09 44 }
8cc709d7d4f013 Steven J. Hill 2016-12-09 45
:::::: The code at line 41 was first introduced by commit
:::::: 8cc709d7d4f013f51d38ceb2e3c8c82d230cf457 MIPS: Relocatable: Provide plat_post_relocation hook
:::::: TO: Steven J. Hill <Steven.Hill(a)cavium.com>
:::::: CC: Ralf Baechle <ralf(a)linux-mips.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH V1 3/6] iio: accel: sca3300: modified to support multi chips
by kernel test robot
Hi LI,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on v5.17-rc1 next-20220124]
[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/LI-Qingwu/i-iio-accel-sca3300-ad...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: parisc-randconfig-r015-20220124 (https://download.01.org/0day-ci/archive/20220124/202201242336.1dSTFe7a-lk...)
compiler: hppa-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/7dc3bc68cdfcb252dd79fea28a5e944d7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review LI-Qingwu/i-iio-accel-sca3300-add-compitible-for-scl3300/20220124-174021
git checkout 7dc3bc68cdfcb252dd79fea28a5e944d76784fe8
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash drivers/iio/accel/
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/iio/accel/sca3300.c:74:60: error: macro "IIO_ENUM_AVAILABLE" requires 3 arguments, but only 2 given
74 | IIO_ENUM_AVAILABLE("op_mode", &sca3300_op_mode_enum),
| ^
In file included from include/linux/iio/buffer.h:10,
from drivers/iio/accel/sca3300.c:17:
include/linux/iio/iio.h:112: note: macro "IIO_ENUM_AVAILABLE" defined here
112 | #define IIO_ENUM_AVAILABLE(_name, _shared, _e) \
|
drivers/iio/accel/sca3300.c:74:9: error: 'IIO_ENUM_AVAILABLE' undeclared here (not in a function)
74 | IIO_ENUM_AVAILABLE("op_mode", &sca3300_op_mode_enum),
| ^~~~~~~~~~~~~~~~~~
>> drivers/iio/accel/sca3300.c:185:31: warning: initialization of 'long unsigned int' from 'const long unsigned int *' makes integer from pointer without a cast [-Wint-conversion]
185 | .scan_masks = sca3300_scan_masks,
| ^~~~~~~~~~~~~~~~~~
drivers/iio/accel/sca3300.c:185:31: note: (near initialization for 'sca3300_chip_info_tbl[0].scan_masks')
drivers/iio/accel/sca3300.c: In function 'sca3300_write_raw':
>> drivers/iio/accel/sca3300.c:307:34: warning: comparison between pointer and integer
307 | if ((val == sca3300_accel_scale[data->chip_info->chip_type][0]) &&
| ^~
drivers/iio/accel/sca3300.c:308:35: warning: comparison between pointer and integer
308 | (val2 == sca3300_accel_scale[data->chip_info->chip_type][1]))
| ^~
drivers/iio/accel/sca3300.c: In function 'sca3300_init':
>> drivers/iio/accel/sca3300.c:422:57: warning: assignment to 'const long unsigned int *' from 'long unsigned int' makes pointer from integer without a cast [-Wint-conversion]
422 | indio_dev->available_scan_masks = sca3300_chip_info_tbl[i].scan_masks;
| ^
vim +185 drivers/iio/accel/sca3300.c
177
178 static const struct sca3300_chip_info sca3300_chip_info_tbl[] = {
179 [CHIP_SCA3300] = {
180 .chip_type = CHIP_SCA3300,
181 .name = "sca3300",
182 .chip_id = 0x51,
183 .channels = sca3300_channels,
184 .num_channels = ARRAY_SIZE(sca3300_channels),
> 185 .scan_masks = sca3300_scan_masks,
186 },
187 };
188
189 DECLARE_CRC8_TABLE(sca3300_crc_table);
190
191 static int sca3300_transfer(struct sca3300_data *sca_data, int *val)
192 {
193 /* Consecutive requests min. 10 us delay (Datasheet section 5.1.2) */
194 struct spi_delay delay = { .value = 10, .unit = SPI_DELAY_UNIT_USECS };
195 int32_t ret;
196 int rs;
197 u8 crc;
198 struct spi_transfer xfers[2] = {
199 {
200 .tx_buf = sca_data->txbuf,
201 .len = ARRAY_SIZE(sca_data->txbuf),
202 .delay = delay,
203 .cs_change = 1,
204 },
205 {
206 .rx_buf = sca_data->rxbuf,
207 .len = ARRAY_SIZE(sca_data->rxbuf),
208 .delay = delay,
209 }
210 };
211
212 /* inverted crc value as described in device data sheet */
213 crc = ~crc8(sca3300_crc_table, &sca_data->txbuf[0], 3, CRC8_INIT_VALUE);
214 sca_data->txbuf[3] = crc;
215
216 ret = spi_sync_transfer(sca_data->spi, xfers, ARRAY_SIZE(xfers));
217 if (ret) {
218 dev_err(&sca_data->spi->dev,
219 "transfer error, error: %d\n", ret);
220 return -EIO;
221 }
222
223 crc = ~crc8(sca3300_crc_table, &sca_data->rxbuf[0], 3, CRC8_INIT_VALUE);
224 if (sca_data->rxbuf[3] != crc) {
225 dev_err(&sca_data->spi->dev, "CRC checksum mismatch");
226 return -EIO;
227 }
228
229 /* get return status */
230 rs = sca_data->rxbuf[0] & SCA3300_MASK_RS_STATUS;
231 if (rs == SCA3300_VALUE_RS_ERROR)
232 ret = -EINVAL;
233
234 *val = sign_extend32(get_unaligned_be16(&sca_data->rxbuf[1]), 15);
235
236 return ret;
237 }
238
239 static int sca3300_error_handler(struct sca3300_data *sca_data)
240 {
241 int ret;
242 int val;
243
244 mutex_lock(&sca_data->lock);
245 sca_data->txbuf[0] = SCA3300_REG_STATUS << 2;
246 ret = sca3300_transfer(sca_data, &val);
247 mutex_unlock(&sca_data->lock);
248 /*
249 * Return status error is cleared after reading status register once,
250 * expect EINVAL here.
251 */
252 if (ret != -EINVAL) {
253 dev_err(&sca_data->spi->dev,
254 "error reading device status: %d\n", ret);
255 return ret;
256 }
257
258 dev_err(&sca_data->spi->dev, "device status: 0x%lx\n",
259 val & SCA3300_STATUS_MASK);
260
261 return 0;
262 }
263
264 static int sca3300_read_reg(struct sca3300_data *sca_data, u8 reg, int *val)
265 {
266 int ret;
267
268 mutex_lock(&sca_data->lock);
269 sca_data->txbuf[0] = reg << 2;
270 ret = sca3300_transfer(sca_data, val);
271 mutex_unlock(&sca_data->lock);
272 if (ret != -EINVAL)
273 return ret;
274
275 return sca3300_error_handler(sca_data);
276 }
277
278 static int sca3300_write_reg(struct sca3300_data *sca_data, u8 reg, int val)
279 {
280 int reg_val = 0;
281 int ret;
282
283 mutex_lock(&sca_data->lock);
284 /* BIT(7) for write operation */
285 sca_data->txbuf[0] = BIT(7) | (reg << 2);
286 put_unaligned_be16(val, &sca_data->txbuf[1]);
287 ret = sca3300_transfer(sca_data, ®_val);
288 mutex_unlock(&sca_data->lock);
289 if (ret != -EINVAL)
290 return ret;
291
292 return sca3300_error_handler(sca_data);
293 }
294
295 static int sca3300_write_raw(struct iio_dev *indio_dev,
296 struct iio_chan_spec const *chan,
297 int val, int val2, long mask)
298 {
299 struct sca3300_data *data = iio_priv(indio_dev);
300 int reg_val;
301 int ret;
302 int i;
303
304 switch (mask) {
305 case IIO_CHAN_INFO_SCALE:
306 for (i = 0; i < OP_MOD_CNT; i++) {
> 307 if ((val == sca3300_accel_scale[data->chip_info->chip_type][0]) &&
308 (val2 == sca3300_accel_scale[data->chip_info->chip_type][1]))
309 return sca3300_write_reg(data, SCA3300_REG_MODE, i);
310 }
311 return -EINVAL;
312 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
313 ret = sca3300_read_reg(data, SCA3300_REG_MODE, ®_val);
314 if (ret)
315 return ret;
316 /* freq. change is possible only for mode 3 and 4 */
317 if (reg_val == 2 && val == sca3300_lp_freq[data->chip_info->chip_type][3])
318 return sca3300_write_reg(data, SCA3300_REG_MODE, 3);
319 if (reg_val == 3 && val == sca3300_lp_freq[data->chip_info->chip_type][2])
320 return sca3300_write_reg(data, SCA3300_REG_MODE, 2);
321 return -EINVAL;
322 default:
323 return -EINVAL;
324 }
325 }
326
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH 3/3] io_uring: zerocopy receive
by kernel test robot
Hi Hao,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.17-rc1 next-20220124]
[cannot apply to horms-ipvs/master]
[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/Hao-Xu/io_uring-zerocopy-receive...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
config: s390-buildonly-randconfig-r004-20220124 (https://download.01.org/0day-ci/archive/20220124/202201242233.64QOWQZ1-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a18910867ba6795066e044293e6daf89edf5)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/0day-ci/linux/commit/295704165d394635876364522d3ac1451...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hao-Xu/io_uring-zerocopy-receive/20220124-174546
git checkout 295704165d394635876364522d3ac1451b62da66
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash
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 fs/io_uring.c:60:
In file included from include/linux/blk-mq.h:8:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from fs/io_uring.c:60:
In file included from include/linux/blk-mq.h:8:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from fs/io_uring.c:60:
In file included from include/linux/blk-mq.h:8:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> fs/io_uring.c:6639:10: error: implicit declaration of function 'io_recvzc_prep' [-Werror,-Wimplicit-function-declaration]
return io_recvzc_prep(req, sqe);
^
fs/io_uring.c:6639:10: note: did you mean 'io_recvmsg_prep'?
fs/io_uring.c:5462:1: note: 'io_recvmsg_prep' declared here
IO_NETOP_PREP_ASYNC(recvmsg);
^
fs/io_uring.c:5454:38: note: expanded from macro 'IO_NETOP_PREP_ASYNC'
#define IO_NETOP_PREP_ASYNC(op) \
^
fs/io_uring.c:5449:12: note: expanded from macro '\
IO_NETOP_PREP'
static int io_##op##_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) \
^
<scratch space>:22:1: note: expanded from here
io_recvmsg_prep
^
>> fs/io_uring.c:6924:9: error: implicit declaration of function 'io_recvzc' [-Werror,-Wimplicit-function-declaration]
ret = io_recvzc(req, issue_flags);
^
fs/io_uring.c:6924:9: note: did you mean 'io_recv'?
fs/io_uring.c:5466:1: note: 'io_recv' declared here
IO_NETOP_FN(recv);
^
fs/io_uring.c:5442:12: note: expanded from macro 'IO_NETOP_FN'
static int io_##op(struct io_kiocb *req, unsigned int issue_flags) \
^
<scratch space>:34:1: note: expanded from here
io_recv
^
12 warnings and 2 errors generated.
vim +/io_recvzc_prep +6639 fs/io_uring.c
6560
6561 static int io_req_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
6562 {
6563 switch (req->opcode) {
6564 case IORING_OP_NOP:
6565 return 0;
6566 case IORING_OP_READV:
6567 case IORING_OP_READ_FIXED:
6568 case IORING_OP_READ:
6569 return io_read_prep(req, sqe);
6570 case IORING_OP_WRITEV:
6571 case IORING_OP_WRITE_FIXED:
6572 case IORING_OP_WRITE:
6573 return io_write_prep(req, sqe);
6574 case IORING_OP_POLL_ADD:
6575 return io_poll_add_prep(req, sqe);
6576 case IORING_OP_POLL_REMOVE:
6577 return io_poll_update_prep(req, sqe);
6578 case IORING_OP_FSYNC:
6579 return io_fsync_prep(req, sqe);
6580 case IORING_OP_SYNC_FILE_RANGE:
6581 return io_sfr_prep(req, sqe);
6582 case IORING_OP_SENDMSG:
6583 case IORING_OP_SEND:
6584 return io_sendmsg_prep(req, sqe);
6585 case IORING_OP_RECVMSG:
6586 case IORING_OP_RECV:
6587 return io_recvmsg_prep(req, sqe);
6588 case IORING_OP_CONNECT:
6589 return io_connect_prep(req, sqe);
6590 case IORING_OP_TIMEOUT:
6591 return io_timeout_prep(req, sqe, false);
6592 case IORING_OP_TIMEOUT_REMOVE:
6593 return io_timeout_remove_prep(req, sqe);
6594 case IORING_OP_ASYNC_CANCEL:
6595 return io_async_cancel_prep(req, sqe);
6596 case IORING_OP_LINK_TIMEOUT:
6597 return io_timeout_prep(req, sqe, true);
6598 case IORING_OP_ACCEPT:
6599 return io_accept_prep(req, sqe);
6600 case IORING_OP_FALLOCATE:
6601 return io_fallocate_prep(req, sqe);
6602 case IORING_OP_OPENAT:
6603 return io_openat_prep(req, sqe);
6604 case IORING_OP_CLOSE:
6605 return io_close_prep(req, sqe);
6606 case IORING_OP_FILES_UPDATE:
6607 return io_rsrc_update_prep(req, sqe);
6608 case IORING_OP_STATX:
6609 return io_statx_prep(req, sqe);
6610 case IORING_OP_FADVISE:
6611 return io_fadvise_prep(req, sqe);
6612 case IORING_OP_MADVISE:
6613 return io_madvise_prep(req, sqe);
6614 case IORING_OP_OPENAT2:
6615 return io_openat2_prep(req, sqe);
6616 case IORING_OP_EPOLL_CTL:
6617 return io_epoll_ctl_prep(req, sqe);
6618 case IORING_OP_SPLICE:
6619 return io_splice_prep(req, sqe);
6620 case IORING_OP_PROVIDE_BUFFERS:
6621 return io_provide_buffers_prep(req, sqe);
6622 case IORING_OP_REMOVE_BUFFERS:
6623 return io_remove_buffers_prep(req, sqe);
6624 case IORING_OP_TEE:
6625 return io_tee_prep(req, sqe);
6626 case IORING_OP_SHUTDOWN:
6627 return io_shutdown_prep(req, sqe);
6628 case IORING_OP_RENAMEAT:
6629 return io_renameat_prep(req, sqe);
6630 case IORING_OP_UNLINKAT:
6631 return io_unlinkat_prep(req, sqe);
6632 case IORING_OP_MKDIRAT:
6633 return io_mkdirat_prep(req, sqe);
6634 case IORING_OP_SYMLINKAT:
6635 return io_symlinkat_prep(req, sqe);
6636 case IORING_OP_LINKAT:
6637 return io_linkat_prep(req, sqe);
6638 case IORING_OP_RECVZC:
> 6639 return io_recvzc_prep(req, sqe);
6640 }
6641
6642 printk_once(KERN_WARNING "io_uring: unhandled opcode %d\n",
6643 req->opcode);
6644 return -EINVAL;
6645 }
6646
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH V1 3/6] iio: accel: sca3300: modified to support multi chips
by kernel test robot
Hi LI,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on v5.17-rc1 next-20220124]
[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/LI-Qingwu/i-iio-accel-sca3300-ad...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: hexagon-randconfig-r033-20220124 (https://download.01.org/0day-ci/archive/20220124/202201242207.0V8eUHu2-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2e58a18910867ba6795066e044293e6daf89edf5)
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://github.com/0day-ci/linux/commit/7dc3bc68cdfcb252dd79fea28a5e944d7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review LI-Qingwu/i-iio-accel-sca3300-add-compitible-for-scl3300/20220124-174021
git checkout 7dc3bc68cdfcb252dd79fea28a5e944d76784fe8
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/iio/accel/
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/iio/accel/sca3300.c:74:53: error: too few arguments provided to function-like macro invocation
IIO_ENUM_AVAILABLE("op_mode", &sca3300_op_mode_enum),
^
include/linux/iio/iio.h:112:9: note: macro 'IIO_ENUM_AVAILABLE' defined here
#define IIO_ENUM_AVAILABLE(_name, _shared, _e) \
^
drivers/iio/accel/sca3300.c:74:2: error: use of undeclared identifier 'IIO_ENUM_AVAILABLE'
IIO_ENUM_AVAILABLE("op_mode", &sca3300_op_mode_enum),
^
>> drivers/iio/accel/sca3300.c:185:17: warning: incompatible pointer to integer conversion initializing 'unsigned long' with an expression of type 'const unsigned long[2]' [-Wint-conversion]
.scan_masks = sca3300_scan_masks,
^~~~~~~~~~~~~~~~~~
>> drivers/iio/accel/sca3300.c:307:13: warning: comparison between pointer and integer ('int' and 'const int *') [-Wpointer-integer-compare]
if ((val == sca3300_accel_scale[data->chip_info->chip_type][0]) &&
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/accel/sca3300.c:308:14: warning: comparison between pointer and integer ('int' and 'const int *') [-Wpointer-integer-compare]
(val2 == sca3300_accel_scale[data->chip_info->chip_type][1]))
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/iio/accel/sca3300.c:422:36: warning: incompatible integer to pointer conversion assigning to 'const unsigned long *' from 'const unsigned long'; take the address with & [-Wint-conversion]
indio_dev->available_scan_masks = sca3300_chip_info_tbl[i].scan_masks;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&
4 warnings and 2 errors generated.
vim +185 drivers/iio/accel/sca3300.c
177
178 static const struct sca3300_chip_info sca3300_chip_info_tbl[] = {
179 [CHIP_SCA3300] = {
180 .chip_type = CHIP_SCA3300,
181 .name = "sca3300",
182 .chip_id = 0x51,
183 .channels = sca3300_channels,
184 .num_channels = ARRAY_SIZE(sca3300_channels),
> 185 .scan_masks = sca3300_scan_masks,
186 },
187 };
188
189 DECLARE_CRC8_TABLE(sca3300_crc_table);
190
191 static int sca3300_transfer(struct sca3300_data *sca_data, int *val)
192 {
193 /* Consecutive requests min. 10 us delay (Datasheet section 5.1.2) */
194 struct spi_delay delay = { .value = 10, .unit = SPI_DELAY_UNIT_USECS };
195 int32_t ret;
196 int rs;
197 u8 crc;
198 struct spi_transfer xfers[2] = {
199 {
200 .tx_buf = sca_data->txbuf,
201 .len = ARRAY_SIZE(sca_data->txbuf),
202 .delay = delay,
203 .cs_change = 1,
204 },
205 {
206 .rx_buf = sca_data->rxbuf,
207 .len = ARRAY_SIZE(sca_data->rxbuf),
208 .delay = delay,
209 }
210 };
211
212 /* inverted crc value as described in device data sheet */
213 crc = ~crc8(sca3300_crc_table, &sca_data->txbuf[0], 3, CRC8_INIT_VALUE);
214 sca_data->txbuf[3] = crc;
215
216 ret = spi_sync_transfer(sca_data->spi, xfers, ARRAY_SIZE(xfers));
217 if (ret) {
218 dev_err(&sca_data->spi->dev,
219 "transfer error, error: %d\n", ret);
220 return -EIO;
221 }
222
223 crc = ~crc8(sca3300_crc_table, &sca_data->rxbuf[0], 3, CRC8_INIT_VALUE);
224 if (sca_data->rxbuf[3] != crc) {
225 dev_err(&sca_data->spi->dev, "CRC checksum mismatch");
226 return -EIO;
227 }
228
229 /* get return status */
230 rs = sca_data->rxbuf[0] & SCA3300_MASK_RS_STATUS;
231 if (rs == SCA3300_VALUE_RS_ERROR)
232 ret = -EINVAL;
233
234 *val = sign_extend32(get_unaligned_be16(&sca_data->rxbuf[1]), 15);
235
236 return ret;
237 }
238
239 static int sca3300_error_handler(struct sca3300_data *sca_data)
240 {
241 int ret;
242 int val;
243
244 mutex_lock(&sca_data->lock);
245 sca_data->txbuf[0] = SCA3300_REG_STATUS << 2;
246 ret = sca3300_transfer(sca_data, &val);
247 mutex_unlock(&sca_data->lock);
248 /*
249 * Return status error is cleared after reading status register once,
250 * expect EINVAL here.
251 */
252 if (ret != -EINVAL) {
253 dev_err(&sca_data->spi->dev,
254 "error reading device status: %d\n", ret);
255 return ret;
256 }
257
258 dev_err(&sca_data->spi->dev, "device status: 0x%lx\n",
259 val & SCA3300_STATUS_MASK);
260
261 return 0;
262 }
263
264 static int sca3300_read_reg(struct sca3300_data *sca_data, u8 reg, int *val)
265 {
266 int ret;
267
268 mutex_lock(&sca_data->lock);
269 sca_data->txbuf[0] = reg << 2;
270 ret = sca3300_transfer(sca_data, val);
271 mutex_unlock(&sca_data->lock);
272 if (ret != -EINVAL)
273 return ret;
274
275 return sca3300_error_handler(sca_data);
276 }
277
278 static int sca3300_write_reg(struct sca3300_data *sca_data, u8 reg, int val)
279 {
280 int reg_val = 0;
281 int ret;
282
283 mutex_lock(&sca_data->lock);
284 /* BIT(7) for write operation */
285 sca_data->txbuf[0] = BIT(7) | (reg << 2);
286 put_unaligned_be16(val, &sca_data->txbuf[1]);
287 ret = sca3300_transfer(sca_data, ®_val);
288 mutex_unlock(&sca_data->lock);
289 if (ret != -EINVAL)
290 return ret;
291
292 return sca3300_error_handler(sca_data);
293 }
294
295 static int sca3300_write_raw(struct iio_dev *indio_dev,
296 struct iio_chan_spec const *chan,
297 int val, int val2, long mask)
298 {
299 struct sca3300_data *data = iio_priv(indio_dev);
300 int reg_val;
301 int ret;
302 int i;
303
304 switch (mask) {
305 case IIO_CHAN_INFO_SCALE:
306 for (i = 0; i < OP_MOD_CNT; i++) {
> 307 if ((val == sca3300_accel_scale[data->chip_info->chip_type][0]) &&
308 (val2 == sca3300_accel_scale[data->chip_info->chip_type][1]))
309 return sca3300_write_reg(data, SCA3300_REG_MODE, i);
310 }
311 return -EINVAL;
312 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
313 ret = sca3300_read_reg(data, SCA3300_REG_MODE, ®_val);
314 if (ret)
315 return ret;
316 /* freq. change is possible only for mode 3 and 4 */
317 if (reg_val == 2 && val == sca3300_lp_freq[data->chip_info->chip_type][3])
318 return sca3300_write_reg(data, SCA3300_REG_MODE, 3);
319 if (reg_val == 3 && val == sca3300_lp_freq[data->chip_info->chip_type][2])
320 return sca3300_write_reg(data, SCA3300_REG_MODE, 2);
321 return -EINVAL;
322 default:
323 return -EINVAL;
324 }
325 }
326
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks