Content-Type: multipart/mixed; boundary="===============2404344367326804523==" MIME-Version: 1.0 From: Valentin Schneider To: kbuild-all@lists.01.org Subject: Re: [PATCH v5 06/17] sched/debug: Output SD flag names rather than their values Date: Wed, 12 Aug 2020 19:51:08 +0100 Message-ID: In-Reply-To: <202008130025.XjiXqp1O%lkp@intel.com> List-Id: --===============2404344367326804523== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 12/08/20 17:35, kernel test robot wrote: > Hi Valentin, > > Thank you for the patch! Perhaps something to improve: > [...] > url: https://github.com/0day-ci/linux/commits/Valentin-Schneider/sched= -Instrument-sched-domain-flags/20200812-205638 > base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 949bc= b8135a96a6923e676646bd29cbe69e8350f > config: i386-randconfig-s001-20200811 (attached as .config) > compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 > reproduce: > # apt-get install sparse > # sparse version: v0.6.2-168-g9554805c-dirty > # save the attached .config to linux build tree > make W=3D1 C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' AR= CH=3Di386 > >>> kernel/sched/debug.c:279:17: sparse: sparse: non size-preserving pointe= r to integer cast >>> kernel/sched/debug.c:279:17: sparse: sparse: non size-preserving intege= r to pointer cast > > 271 > 272 tmp =3D kcalloc(data_size + 1, sizeof(tmp), GFP_KERNEL); > 273 for_each_set_bit(idx, &flags, __SD_FLAG_CNT) { > 274 char *name =3D sd_flag_debug[idx].name; > 275 > 276 len +=3D snprintf(tmp + len, strlen(name) + 2, "%s ", name); > 277 } > 278 > > 279 tmp +=3D *ppos; I pretty much copied kernel/sysctl.c::_proc_do_string() and I think that's exactly the same types here: char* buffer incremented by loff_t offset. It does look fine to me, but I can't really parse that warning. > 280 len -=3D *ppos; > 281 > 282 if (len > *lenp) > 283 len =3D *lenp; > 284 if (len) > 285 memcpy(buffer, tmp, len); > 286 if (len < *lenp) { > 287 ((char *)buffer)[len] =3D '\n'; > 288 len++; > 289 } > 290 > 291 *lenp =3D len; > 292 *ppos +=3D len; > 293 > 294 kfree(tmp); > 295 > 296 return 0; > 297 } > 298 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============2404344367326804523==--