* [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec
@ 2023-07-25 11:40 Colin Ian King
2023-07-25 16:03 ` Carl Vanderlip
2023-07-26 3:00 ` Jeffrey Hugo
0 siblings, 2 replies; 5+ messages in thread
From: Colin Ian King @ 2023-07-25 11:40 UTC (permalink / raw)
To: Jeffrey Hugo, Carl Vanderlip, Pranjal Ramajor Asha Kanojiya,
Oded Gabbay, linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
Pointer pexec is being assigned a value however it is never read. The
assignment is redundant and can be removed.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/accel/qaic/qaic_data.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index e9a1cb779b30..8a6cb14f490e 100644
--- a/drivers/accel/qaic/qaic_data.c
+++ b/drivers/accel/qaic/qaic_data.c
@@ -1320,7 +1320,6 @@ static int __qaic_execute_bo_ioctl(struct drm_device *dev, void *data, struct dr
user_data = u64_to_user_ptr(args->data);
exec = kcalloc(args->hdr.count, size, GFP_KERNEL);
- pexec = (struct qaic_partial_execute_entry *)exec;
if (!exec)
return -ENOMEM;
--
2.39.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec
2023-07-25 11:40 [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec Colin Ian King
@ 2023-07-25 16:03 ` Carl Vanderlip
2023-07-26 3:00 ` Jeffrey Hugo
1 sibling, 0 replies; 5+ messages in thread
From: Carl Vanderlip @ 2023-07-25 16:03 UTC (permalink / raw)
To: Colin Ian King, Jeffrey Hugo, Pranjal Ramajor Asha Kanojiya,
Oded Gabbay, linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
On 7/25/2023 4:40 AM, Colin Ian King wrote:
> Pointer pexec is being assigned a value however it is never read. The
> assignment is redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec
2023-07-25 11:40 [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec Colin Ian King
2023-07-25 16:03 ` Carl Vanderlip
@ 2023-07-26 3:00 ` Jeffrey Hugo
2023-07-26 13:38 ` Pranjal Ramajor Asha Kanojiya
1 sibling, 1 reply; 5+ messages in thread
From: Jeffrey Hugo @ 2023-07-26 3:00 UTC (permalink / raw)
To: Colin Ian King, Carl Vanderlip, Pranjal Ramajor Asha Kanojiya,
Oded Gabbay, linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
On 7/25/2023 5:40 AM, Colin Ian King wrote:
> Pointer pexec is being assigned a value however it is never read. The
> assignment is redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/accel/qaic/qaic_data.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
> index e9a1cb779b30..8a6cb14f490e 100644
> --- a/drivers/accel/qaic/qaic_data.c
> +++ b/drivers/accel/qaic/qaic_data.c
> @@ -1320,7 +1320,6 @@ static int __qaic_execute_bo_ioctl(struct drm_device *dev, void *data, struct dr
> user_data = u64_to_user_ptr(args->data);
>
> exec = kcalloc(args->hdr.count, size, GFP_KERNEL);
> - pexec = (struct qaic_partial_execute_entry *)exec;
> if (!exec)
> return -ENOMEM;
>
It does look like pexec is not used in this function after it was
refactored. Shouldn't the declaration at the beginning of the function
also be removed?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec
2023-07-26 3:00 ` Jeffrey Hugo
@ 2023-07-26 13:38 ` Pranjal Ramajor Asha Kanojiya
2023-07-26 13:52 ` Colin King (gmail)
0 siblings, 1 reply; 5+ messages in thread
From: Pranjal Ramajor Asha Kanojiya @ 2023-07-26 13:38 UTC (permalink / raw)
To: Jeffrey Hugo, Colin Ian King, Carl Vanderlip, Oded Gabbay,
linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
On 7/26/2023 8:30 AM, Jeffrey Hugo wrote:
> On 7/25/2023 5:40 AM, Colin Ian King wrote:
>> Pointer pexec is being assigned a value however it is never read. The
>> assignment is redundant and can be removed.
>>
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>> ---
>> drivers/accel/qaic/qaic_data.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/accel/qaic/qaic_data.c
>> b/drivers/accel/qaic/qaic_data.c
>> index e9a1cb779b30..8a6cb14f490e 100644
>> --- a/drivers/accel/qaic/qaic_data.c
>> +++ b/drivers/accel/qaic/qaic_data.c
>> @@ -1320,7 +1320,6 @@ static int __qaic_execute_bo_ioctl(struct
>> drm_device *dev, void *data, struct dr
>> user_data = u64_to_user_ptr(args->data);
>> exec = kcalloc(args->hdr.count, size, GFP_KERNEL);
>> - pexec = (struct qaic_partial_execute_entry *)exec;
>> if (!exec)
>> return -ENOMEM;
>
> It does look like pexec is not used in this function after it was
> refactored. Shouldn't the declaration at the beginning of the function
> also be removed?
Yeah we should remove the declaration as well. Although it is used some
where to calculate its size i.e. sizeof(*pexec). We need to directly use
the type in sizeof() i.e. sizeof(struct qaic_partial_execute_entry).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec
2023-07-26 13:38 ` Pranjal Ramajor Asha Kanojiya
@ 2023-07-26 13:52 ` Colin King (gmail)
0 siblings, 0 replies; 5+ messages in thread
From: Colin King (gmail) @ 2023-07-26 13:52 UTC (permalink / raw)
To: Pranjal Ramajor Asha Kanojiya, Jeffrey Hugo, Carl Vanderlip,
Oded Gabbay, linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
On 26/07/2023 14:38, Pranjal Ramajor Asha Kanojiya wrote:
>
>
> On 7/26/2023 8:30 AM, Jeffrey Hugo wrote:
>> On 7/25/2023 5:40 AM, Colin Ian King wrote:
>>> Pointer pexec is being assigned a value however it is never read. The
>>> assignment is redundant and can be removed.
>>>
>>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>>> ---
>>> drivers/accel/qaic/qaic_data.c | 1 -
>>> 1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/accel/qaic/qaic_data.c
>>> b/drivers/accel/qaic/qaic_data.c
>>> index e9a1cb779b30..8a6cb14f490e 100644
>>> --- a/drivers/accel/qaic/qaic_data.c
>>> +++ b/drivers/accel/qaic/qaic_data.c
>>> @@ -1320,7 +1320,6 @@ static int __qaic_execute_bo_ioctl(struct
>>> drm_device *dev, void *data, struct dr
>>> user_data = u64_to_user_ptr(args->data);
>>> exec = kcalloc(args->hdr.count, size, GFP_KERNEL);
>>> - pexec = (struct qaic_partial_execute_entry *)exec;
>>> if (!exec)
>>> return -ENOMEM;
>>
>> It does look like pexec is not used in this function after it was
>> refactored. Shouldn't the declaration at the beginning of the
>> function also be removed?
>
> Yeah we should remove the declaration as well. Although it is used some
> where to calculate its size i.e. sizeof(*pexec). We need to directly use
> the type in sizeof() i.e. sizeof(struct qaic_partial_execute_entry).
I didn't remove the variable because of the sizeof(), but it makes sense
to remove it. I'll send a V2 today
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-26 13:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 11:40 [PATCH][next] accel/qaic: remove redundant assignment to pointer pexec Colin Ian King
2023-07-25 16:03 ` Carl Vanderlip
2023-07-26 3:00 ` Jeffrey Hugo
2023-07-26 13:38 ` Pranjal Ramajor Asha Kanojiya
2023-07-26 13:52 ` Colin King (gmail)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®