* [PATCH][V2][next] accel/qaic: remove redundant pointer pexec
@ 2023-07-26 14:06 Colin Ian King
2023-08-01 14:05 ` Pranjal Ramajor Asha Kanojiya
0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2023-07-26 14:06 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. Replace sizeof(*pexec)
with sizeof the type and remove the declaration of pointer pexec.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
V2: completely remove the declaration of pexec and replace sizeof(*pexec)
with size of the type.
---
drivers/accel/qaic/qaic_data.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index e9a1cb779b30..a90b64b325b4 100644
--- a/drivers/accel/qaic/qaic_data.c
+++ b/drivers/accel/qaic/qaic_data.c
@@ -1292,7 +1292,6 @@ static void update_profiling_data(struct drm_file *file_priv,
static int __qaic_execute_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv,
bool is_partial)
{
- struct qaic_partial_execute_entry *pexec;
struct qaic_execute *args = data;
struct qaic_execute_entry *exec;
struct dma_bridge_chan *dbc;
@@ -1312,7 +1311,7 @@ static int __qaic_execute_bo_ioctl(struct drm_device *dev, void *data, struct dr
received_ts = ktime_get_ns();
- size = is_partial ? sizeof(*pexec) : sizeof(*exec);
+ size = is_partial ? sizeof(struct qaic_partial_execute_entry) : sizeof(*exec);
n = (unsigned long)size * args->hdr.count;
if (args->hdr.count == 0 || n / args->hdr.count != size)
return -EINVAL;
@@ -1320,7 +1319,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 related [flat|nested] 3+ messages in thread
* Re: [PATCH][V2][next] accel/qaic: remove redundant pointer pexec
2023-07-26 14:06 [PATCH][V2][next] accel/qaic: remove redundant pointer pexec Colin Ian King
@ 2023-08-01 14:05 ` Pranjal Ramajor Asha Kanojiya
2023-08-02 15:16 ` Jeffrey Hugo
0 siblings, 1 reply; 3+ messages in thread
From: Pranjal Ramajor Asha Kanojiya @ 2023-08-01 14:05 UTC (permalink / raw)
To: Colin Ian King, Jeffrey Hugo, Carl Vanderlip, Oded Gabbay,
linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
On 7/26/2023 7:36 PM, Colin Ian King wrote:
> Pointer pexec is being assigned a value however it is never read. The
> assignment is redundant and can be removed. Replace sizeof(*pexec)
> with sizeof the type and remove the declaration of pointer pexec.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][V2][next] accel/qaic: remove redundant pointer pexec
2023-08-01 14:05 ` Pranjal Ramajor Asha Kanojiya
@ 2023-08-02 15:16 ` Jeffrey Hugo
0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey Hugo @ 2023-08-02 15:16 UTC (permalink / raw)
To: Pranjal Ramajor Asha Kanojiya, Colin Ian King, Carl Vanderlip,
Oded Gabbay, linux-arm-msm, dri-devel
Cc: kernel-janitors, linux-kernel
On 8/1/2023 8:05 AM, Pranjal Ramajor Asha Kanojiya wrote:
>
>
> On 7/26/2023 7:36 PM, Colin Ian King wrote:
>> Pointer pexec is being assigned a value however it is never read. The
>> assignment is redundant and can be removed. Replace sizeof(*pexec)
>> with sizeof the type and remove the declaration of pointer pexec.
>>
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>
> Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Applied to drm-misc-next
Thanks!
-Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-02 16:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-26 14:06 [PATCH][V2][next] accel/qaic: remove redundant pointer pexec Colin Ian King
2023-08-01 14:05 ` Pranjal Ramajor Asha Kanojiya
2023-08-02 15:16 ` Jeffrey Hugo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox