Skip to contentSkip to conversation

accel/qaic: remove redundant pointer pexec

PATCH Applied Colin Ian King 3 participants 3 messages Jul 26, 2023 – Aug 2, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 accel/qaic: remove redundant pointer pexec

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.

---

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(-)
drivers/accel/qaic/qaic_data.c +1 -3
index e9a1cb779b30..a90b64b325b4 100644
@@ -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;
 
Signature · 1 line
2.39.2
Reviewed-by Applied
#2 lore raw
Quoted 11 lines · Pranjal Ramajor Asha Kanojiya
Quoted 5 lines · Colin Ian King

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.

Applied to drm-misc-next

Thanks!

-Jeff