All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: fix application of sizeof to pointer
       [not found] <20230720073355.3196-1-xujianghui@cdjrlc.com>
@ 2023-07-20  7:35   ` sunran001
  0 siblings, 0 replies; 3+ messages in thread
From: sunran001 @ 2023-07-20  7:35 UTC (permalink / raw)
  To: airlied, daniel; +Cc: linux-kernel, dri-devel

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application
of sizeof to pointer

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] drm/i915: fix application of sizeof to pointer
@ 2023-07-20  7:35   ` sunran001
  0 siblings, 0 replies; 3+ messages in thread
From: sunran001 @ 2023-07-20  7:35 UTC (permalink / raw)
  To: airlied, daniel; +Cc: dri-devel, linux-kernel

The coccinelle check report:
./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application
of sizeof to pointer

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: fix application of sizeof to pointer
  2023-07-20  7:35   ` sunran001
  (?)
@ 2023-07-31  9:56   ` Jani Nikula
  -1 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2023-07-31  9:56 UTC (permalink / raw)
  To: sunran001, airlied, daniel; +Cc: linux-kernel, dri-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-31  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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-20  7:35   ` sunran001
2023-07-31  9:56   ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.