Re: [PATCH] lib: dynamic_queue_limits: use memset and offsetof init

From: Yejune Deng
Date: Fri Jan 15 2021 - 19:53:57 EST


Sorry.It failed in ARCH nds32,I will fix it in the next submit.


On Fri, Jan 15, 2021 at 2:33 PM Yejune Deng <yejune.deng@xxxxxxxxx> wrote:
>
> My patch is applied to linux-next/master tree.I also built in arch
> arm64 and x86_64,is OK.Is something wrong with that?
>
> On Fri, Jan 15, 2021 at 12:45 PM kernel test robot <lkp@xxxxxxxxx> wrote:
> >
> > Hi Yejune,
> >
> > Thank you for the patch! Yet something to improve:
> >
> > [auto build test ERROR on linus/master]
> > [also build test ERROR on v5.11-rc3 next-20210114]
> > [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/Yejune-Deng/lib-dynamic_queue_limits-use-memset-and-offsetof-init/20210115-112707
> > base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 146620506274bd24d52fb1c589110a30eed8240b
> > config: nds32-randconfig-m031-20210115 (attached as .config)
> > compiler: nds32le-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://github.com/0day-ci/linux/commit/9be25b076f67d15d29016cb613b95d2ae190a9b4
> > git remote add linux-review https://github.com/0day-ci/linux
> > git fetch --no-tags linux-review Yejune-Deng/lib-dynamic_queue_limits-use-memset-and-offsetof-init/20210115-112707
> > git checkout 9be25b076f67d15d29016cb613b95d2ae190a9b4
> > # save the attached .config to linux build tree
> > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> >
> > All error/warnings (new ones prefixed by >>):
> >
> > lib/dynamic_queue_limits.c: In function 'dql_reset':
> > >> lib/dynamic_queue_limits.c:119:2: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
> > 119 | memset(dql, 0, offsetof(struct dql, lowest_slack));
> > | ^~~~~~
> > >> lib/dynamic_queue_limits.c:119:2: warning: incompatible implicit declaration of built-in function 'memset'
> > lib/dynamic_queue_limits.c:11:1: note: include '<string.h>' or provide a declaration of 'memset'
> > 10 | #include <linux/dynamic_queue_limits.h>
> > +++ |+#include <string.h>
> > 11 | #include <linux/compiler.h>
> > cc1: some warnings being treated as errors
> >
> >
> > vim +/memset +119 lib/dynamic_queue_limits.c
> >
> > 115
> > 116 void dql_reset(struct dql *dql)
> > 117 {
> > 118 /* Reset all dynamic values */
> > > 119 memset(dql, 0, offsetof(struct dql, lowest_slack));
> > 120 dql->lowest_slack = UINT_MAX;
> > 121 dql->slack_start_time = jiffies;
> > 122 }
> > 123 EXPORT_SYMBOL(dql_reset);
> > 124
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx