From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934290AbeALO2I (ORCPT + 1 other); Fri, 12 Jan 2018 09:28:08 -0500 Received: from mga09.intel.com ([134.134.136.24]:8097 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933810AbeALO2G (ORCPT ); Fri, 12 Jan 2018 09:28:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,349,1511856000"; d="scan'208";a="18700191" Subject: Re: [Intel-gfx] [PATCH] drm/i915/pmu: fix noderef.cocci warnings To: kbuild test robot , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, kbuild-all@01.org, Rodrigo Vivi References: <201801122113.PamSF4io%fengguang.wu@intel.com> <20180112133116.GA14498@lkp-ib03> From: Tvrtko Ursulin Message-ID: Date: Fri, 12 Jan 2018 14:28:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180112133116.GA14498@lkp-ib03> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 12/01/2018 13:31, kbuild test robot wrote: > From: Fengguang Wu > > drivers/gpu/drm/i915/i915_pmu.c:795:34-40: 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 > > Fixes: 109ec558370f ("drm/i915/pmu: Only enumerate available counters in sysfs") > Signed-off-by: Fengguang Wu > --- > > i915_pmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/drivers/gpu/drm/i915/i915_pmu.c > +++ b/drivers/gpu/drm/i915/i915_pmu.c > @@ -792,7 +792,7 @@ create_event_attributes(struct drm_i915_ > goto err_alloc; > > /* Max one pointer of each attribute type plus a termination entry. */ > - attr = kzalloc((count * 2 + 1) * sizeof(attr), GFP_KERNEL); > + attr = kzalloc((count * 2 + 1) * sizeof(*attr), GFP_KERNEL); > if (!attr) > goto err_alloc; > Luckily it is the same size so no actual bug, but fix is still valid. Will merge it once it passes CI, thanks! Reviewed-by: Tvrtko Ursulin Regards, Tvrtko