Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4232511rwb; Mon, 31 Jul 2023 03:55:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlGWvs9gYCJXi8dAp/0x/bn2/r4dsHcdo3pL3NBTQtPx8oXjO9yG1K+dBMjR2Pm/FlXboS/4 X-Received: by 2002:a05:6a20:3216:b0:133:be9d:a9e6 with SMTP id hl22-20020a056a20321600b00133be9da9e6mr9052891pzc.17.1690800908929; Mon, 31 Jul 2023 03:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690800908; cv=none; d=google.com; s=arc-20160816; b=CMDMK0HLVDaEBfMgdwa6x8ktKWpss3Z2POy7wE1q8yVQFWB1VWfNHJx+xEbCw9dw6U j6mAOy/HFCJFzW0L0TF6QXEwP9VsOoy2pEJwse3oKIXxu1BLYacj3xmace/kwwzz80hn pRpavfHgKmorfVVwl1981uqXzUSEnjDqKEox1x/5JReisEjfDfEEhrhHAciNIhUofV1W QL6vUVZoNDwZdnKfJIiwJi+4QwIN0UdXcWHC1QsJ36xl5hKShwvlbpeSI5Cqn3fUPHvH UQVQSP5/wRU+Byn39pi+iae8m9K1p69T0+08p0roIfQGl+n5CgLrSQdeLTYB6hp21cyv PdrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=dGOv4Bb3PhG+RnUyGk2H/+C07moKS7rrNkSQrY9Q6+I=; fh=8Nnqa4r9g9DOj+t1a5FxxI3zQolJnQjSz9IlvHH1jbE=; b=VX5y/s7yBoTusV5pGEGmLwCTx4w/bpYyYQr0Z77/OkPwITQO97WVd6qhY3osW2dSmr hhaRJVa03O77tUJQDj023lodFAOS4Wig/obBQF9yPzW4vTB9QwMy2KoSnViv7Z9Hkl8n Ghct2Yjzx/LPufoXp3+r7bXFxuy3w+ZwjBn2p4b4jx9t9v/Oh8mV6HfBrG4LcOpCPdSF 6YAKBGzw9+Mp/sFCb/UWWDju0c+agVmRA0/hplmAapYHYlUZMvuwfMIbMzqtEEbSg6GM M3WdMnilooEUyUyDQ3FpWH2ZIxcD9sC3wAAwO19U8zePQPpew01EWxJxK5XSIODrKbRU xnRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HA7RNsa4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n14-20020a65488e000000b00563e87fe3dcsi3212159pgs.548.2023.07.31.03.54.56; Mon, 31 Jul 2023 03:55:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HA7RNsa4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232010AbjGaJ5D (ORCPT + 99 others); Mon, 31 Jul 2023 05:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbjGaJ4k (ORCPT ); Mon, 31 Jul 2023 05:56:40 -0400 Received: from mgamail.intel.com (unknown [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3F95E44 for ; Mon, 31 Jul 2023 02:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690797375; x=1722333375; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=1oL+ZoSZBkg9yYNkBmf41Emceg10dKGbAKKXHudy5G0=; b=HA7RNsa4+cpAwdBwl5KSk2NcfuzUiMZO1Glt9tRWqSInz1vfVddwyyTo Fc/pZ5761mtapXXHmljG9SsBvNWbN8F0q1u9wAy7u8hBWtA3fwc1nW223 6hctjVAD94oqgNudjbaeoxQz8yb5ZGvkjKrTz59y9WUKgywkndjX8BuZn u1qeKe2+KTd10eLgdbJkvPU3Vb7ZWfvTi2YUqV9gHAFOVWsmqTgWEQ63e ZkkPvUKs2OX+HQ1LhFdyrLWxc57XntCuUJbM3KNY5GZ+TQFXLu4EhtAOL spYLX/Z+Rq8F0WE3WCi8gMl6fL1ahfe3+weAgHBuz2TFE0dlY69Bpsusz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="366456225" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="366456225" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 02:56:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="974815497" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="974815497" Received: from naikshri-mobl7.ger.corp.intel.com (HELO localhost) ([10.252.36.230]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 02:56:08 -0700 From: Jani Nikula To: sunran001@208suo.com, airlied@gmail.com, daniel@ffwll.ch Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/i915: fix application of sizeof to pointer In-Reply-To: <442918910b90b9a8e2e5f8a3874fdb44@208suo.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230720073355.3196-1-xujianghui@cdjrlc.com> <442918910b90b9a8e2e5f8a3874fdb44@208suo.com> Date: Mon, 31 Jul 2023 12:56:05 +0300 Message-ID: <87leewxv4a.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Jul 2023, sunran001@208suo.com wrote: > The coccinelle check report: > ./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application > of sizeof to pointer Please don't just assume coccinelle is right, and send "fixes" based on the cocci reports alone. You need to read and understand the code you're changing. BR, Jani. > > Signed-off-by: Ran Sun > --- > drivers/gpu/drm/i915/i915_syncmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_syncmap.c > b/drivers/gpu/drm/i915/i915_syncmap.c > index 60404dbb2e9f..4eeaf12be72d 100644 > --- a/drivers/gpu/drm/i915/i915_syncmap.c > +++ b/drivers/gpu/drm/i915/i915_syncmap.c > @@ -282,7 +282,7 @@ static noinline int __sync_set(struct i915_syncmap > **root, u64 id, u32 seqno) > unsigned int above; > > /* Insert a join above the current layer */ > - next = kzalloc(sizeof(*next) + KSYNCMAP * sizeof(next), > + next = kzalloc(sizeof(*next) + KSYNCMAP * sizeof(*next), > GFP_KERNEL); > if (unlikely(!next)) > return -ENOMEM; -- Jani Nikula, Intel Open Source Graphics Center