Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp725264pxa; Wed, 12 Aug 2020 11:52:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoR+jwfttcI7IzZbYL0HLhsSluEav5NfWFix8cKP+ffqUPXHoDHvfXWgp0EjZ/+2DLrJI7 X-Received: by 2002:a17:906:12d8:: with SMTP id l24mr1214067ejb.260.1597258362886; Wed, 12 Aug 2020 11:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597258362; cv=none; d=google.com; s=arc-20160816; b=r1CERr3q4R4WrqQyHQITFhpgCUPiblF+FJX1TGDu8kFuYyWhfnhIfEGJAWBeb8ktAQ ydUgxvahzkYXC6W4lXHF7Mb9G5muf8/f1lXbXwcoKmwqtkjLccp1hdTyvtkWzhmGjItv eRqChsti+f1uP+gi0ul1M717DQkT1yYCbq3/Le36Ki2QKD++CEiQGIeeEpim61CC+B1A BVEZsQezJKKhqNDbFExKBpB4ZswdMp0AhOlRlWCnaAR+YgGaf7Y/lzgJHsLq+AwXPgJN 4RFKYrZfTOGFUI0FiS7WtVuOSDy64teLiHhf0uQDqdOW+UEAcjnx+tNRHkkIQMH6Tq6K huVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=u+T6JjG32o54/cVN88MbGIlMo72zxyIWgaK2+Ghm9mI=; b=hjqqOzsb6AwT/p9hKHjlLfmWziqnQUPx/XFPap/tbCEx+d6j/HuLTnBamFsWB1uyWe T54Cda7b9lv9BRw6PVY0as7iiBUD3O0YivwRymgKqki8FR7GqFrdMA7dQ+FzBmPAOSaB Os2Z+IrLg71LMR1BtEGKXdP0i5buN/S1sFuW3ue+79aNqqtbdlN+PMP+VPjZzADw//AY 3Kj6cl8b2/v/rwlgfIhwki9vicgbZTpwHtBqw8vydetgLzomSjDzKAj/4qYoFS+cDY97 fRQw7tA1sb0G2c+9XvVuDvo/18mX6CgCQ8Es86Jd3Oe1pkqiXvEg4D3IjVThM+J9CQoa vcAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si1714863ejf.352.2020.08.12.11.52.18; Wed, 12 Aug 2020 11:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbgHLSvQ (ORCPT + 99 others); Wed, 12 Aug 2020 14:51:16 -0400 Received: from foss.arm.com ([217.140.110.172]:47586 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbgHLSvP (ORCPT ); Wed, 12 Aug 2020 14:51:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E256CD6E; Wed, 12 Aug 2020 11:51:14 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 929C53F22E; Wed, 12 Aug 2020 11:51:13 -0700 (PDT) References: <20200812125300.11889-7-valentin.schneider@arm.com> <202008130025.XjiXqp1O%lkp@intel.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: kernel test robot Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kbuild-all@lists.01.org, mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, Quentin Perret Subject: Re: [PATCH v5 06/17] sched/debug: Output SD flag names rather than their values In-reply-to: <202008130025.XjiXqp1O%lkp@intel.com> Date: Wed, 12 Aug 2020 19:51:08 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 949bcb8135a96a6923e676646bd29cbe69e8350f > 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=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 > >>> kernel/sched/debug.c:279:17: sparse: sparse: non size-preserving pointer to integer cast >>> kernel/sched/debug.c:279:17: sparse: sparse: non size-preserving integer to pointer cast > > 271 > 272 tmp = kcalloc(data_size + 1, sizeof(tmp), GFP_KERNEL); > 273 for_each_set_bit(idx, &flags, __SD_FLAG_CNT) { > 274 char *name = sd_flag_debug[idx].name; > 275 > 276 len += snprintf(tmp + len, strlen(name) + 2, "%s ", name); > 277 } > 278 > > 279 tmp += *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 -= *ppos; > 281 > 282 if (len > *lenp) > 283 len = *lenp; > 284 if (len) > 285 memcpy(buffer, tmp, len); > 286 if (len < *lenp) { > 287 ((char *)buffer)[len] = '\n'; > 288 len++; > 289 } > 290 > 291 *lenp = len; > 292 *ppos += 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@lists.01.org