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; > 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 27A71C433DF for ; Wed, 12 Aug 2020 18:53:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D821A20774 for ; Wed, 12 Aug 2020 18:53:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QdOUv4rb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D821A20774 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:In-reply-to:Subject:To: From:References:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5/iOqz58L/miXhQ5KJhNy1FibgN7nFBv7WvrTm6d6bM=; b=QdOUv4rbR1GkMqVNKRBkTIATv Q/GQvjjWstCAgk7Ob9ZwXqzA9vmh1XVL5ysp56HJUSX4mdVAjjg3piGZiwEAY17eX2erGkrdG8gAd AfFKchsDE/hzVZDjBm+1z7rPsJuk6Ua7WQq/MIp0+5mGBg3f1i+cCqYYx1jM6Cg0YbyEDNtZs7Hxu MKmdJ2tQGvLNfKT6nfaiEJ17cxONn7aHWhok0f35/5mz6g2jCA2HpAxIiGAo9ScKXL9Lkt2xftHVq cAegAI/s1iCcl5H3ENpw9Zyn1HXtww1jZr45i4TNJlplMzTf1yNTNrmgKze9I4NWLT6gW07vlLsX8 No53AR3cw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5vrB-0000Ny-V4; Wed, 12 Aug 2020 18:52:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5vr9-0000MQ-Au for linux-arm-kernel@lists.infradead.org; Wed, 12 Aug 2020 18:52:12 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200812_145211_497372_F852959C X-CRM114-Status: GOOD ( 14.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: morten.rasmussen@arm.com, vincent.guittot@linaro.org, Quentin Perret , peterz@infradead.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, kbuild-all@lists.01.org, mingo@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2123205928105782211==" MIME-Version: 1.0 From: Valentin Schneider To: kbuild-all@lists.01.org Subject: Re: [PATCH] sched/debug: fix noderef.cocci warnings Date: Wed, 12 Aug 2020 19:52:07 +0100 Message-ID: In-Reply-To: <20200812175958.GA94389@b1d876c4bf9f> List-Id: --===============2123205928105782211== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 949bc= b8135a96a6923e676646bd29cbe69e8350f > > 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 =3D kcalloc(data_size + 1, sizeof(tmp), GFP_KERNEL); > + tmp =3D 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 =3D sd_flag_debug[idx].name; > --===============2123205928105782211==--