From: Jani Nikula <jani.nikula@linux.intel.com>
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
Date: Mon, 31 Jul 2023 12:56:05 +0300 [thread overview]
Message-ID: <87leewxv4a.fsf@intel.com> (raw)
In-Reply-To: <442918910b90b9a8e2e5f8a3874fdb44@208suo.com>
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 <sunran001@208suo.com>
> ---
> 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
prev parent reply other threads:[~2023-07-31 9:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230720073355.3196-1-xujianghui@cdjrlc.com>
2023-07-20 7:35 ` [PATCH] drm/i915: fix application of sizeof to pointer sunran001
2023-07-31 9:56 ` Jani Nikula [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87leewxv4a.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sunran001@208suo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox