[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202110280058.0MGt3P9p-lkp@intel.com>
Date: Thu, 28 Oct 2021 00:34:49 +0800
From: kernel test robot <lkp@...el.com>
To: Michael Chan <michael.chan@...adcom.com>, davem@...emloft.net
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
netdev@...r.kernel.org, kuba@...nel.org, edwin.peer@...adcom.com,
gospo@...adcom.com, jiri@...dia.com
Subject: Re: [PATCH net-next 14/19] bnxt_en: extract coredump command line
from current task
Hi Michael,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Michael-Chan/bnxt_en-devlink-enhancements/20211024-111540
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git ab98bbee072c7c30c391ae742b209efebb468273
config: i386-buildonly-randconfig-r005-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
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/15b3030c5fb659f04e1631e112d2f57e8475dcad
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michael-Chan/bnxt_en-devlink-enhancements/20211024-111540
git checkout 15b3030c5fb659f04e1631e112d2f57e8475dcad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
>> drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c:205:9: error: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned long *') and 'typeof (sizeof (record->commandline) - 1) *' (aka 'unsigned int *')) [-Werror,-Wcompare-distinct-pointer-types]
len = min(len, sizeof(record->commandline) - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
1 error generated.
vim +205 drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c
196
197 static void bnxt_fill_cmdline(struct bnxt_coredump_record *record)
198 {
199 struct mm_struct *mm = current->mm;
200
201 if (mm) {
202 unsigned long len = mm->arg_end - mm->arg_start;
203 int i, last = 0;
204
> 205 len = min(len, sizeof(record->commandline) - 1);
206 if (len && !copy_from_user(record->commandline,
207 (char __user *)mm->arg_start, len)) {
208 for (i = 0; i < len; i++) {
209 if (record->commandline[i])
210 last = i;
211 else
212 record->commandline[i] = ' ';
213 }
214 record->commandline[last + 1] = 0;
215 return;
216 }
217 }
218
219 strscpy(record->commandline, current->comm, TASK_COMM_LEN);
220 }
221
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (40133 bytes)
Powered by blists - more mailing lists