From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3671C433DF for ; Wed, 12 Aug 2020 18:52:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0D3220774 for ; Wed, 12 Aug 2020 18:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbgHLSwL (ORCPT ); Wed, 12 Aug 2020 14:52:11 -0400 Received: from foss.arm.com ([217.140.110.172]:47608 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726447AbgHLSwL (ORCPT ); Wed, 12 Aug 2020 14:52:11 -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 87974D6E; Wed, 12 Aug 2020 11:52:10 -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 3646B3F22E; Wed, 12 Aug 2020 11:52:09 -0700 (PDT) References: <20200812125300.11889-7-valentin.schneider@arm.com> <20200812175958.GA94389@b1d876c4bf9f> 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] sched/debug: fix noderef.cocci warnings In-reply-to: <20200812175958.GA94389@b1d876c4bf9f> Date: Wed, 12 Aug 2020 19:52:07 +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 18:59, kernel test robot wrote: > From: kernel test robot > > kernel/sched/debug.c:272:30-36: ERROR: application of sizeof to pointer > > sizeof when applied to a pointer typed expression gives the size of > the pointer > > Generated by: scripts/coccinelle/misc/noderef.cocci > > CC: Valentin Schneider > Signed-off-by: kernel test robot > --- > > 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 > > debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/kernel/sched/debug.c > +++ b/kernel/sched/debug.c > @@ -269,7 +269,7 @@ static int sd_ctl_doflags(struct ctl_tab > return 0; > } > > - tmp = kcalloc(data_size + 1, sizeof(tmp), GFP_KERNEL); > + tmp = kcalloc(data_size + 1, sizeof(*tmp), GFP_KERNEL); Praised be coccinelle for rubbing in my face that I can't write code; also I'm not even checking if the allocation succeeded which is clearly daft, even if this is debug stuff. I'll blame the heat and try to move on... > for_each_set_bit(idx, &flags, __SD_FLAG_CNT) { > char *name = sd_flag_debug[idx].name; >