Skip to contentSkip to conversation

drm/vc4: remove redundant assignment of variable size

PATCH Applied Colin Ian King 2 participants 2 messages Jan 12, 2022 – Jan 14, 2022

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

PATCH 1/1 drm/vc4: remove redundant assignment of variable size

The variable 'size' is being assigned a value that is never read, the assignment is redundant and can be removed. Cleans up clang-scan warning:

drivers/gpu/drm/vc4/vc4_bo.c:358:2: warning: Value stored to 'size' is never read [deadcode.DeadStores]

        size = roundup(size, PAGE_SIZE);
---
 drivers/gpu/drm/vc4/vc4_bo.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/vc4/vc4_bo.c +0 -2
index 6d1281a343e9..e451cc5bcfac 100644
@@ -355,8 +355,6 @@ static struct vc4_bo *vc4_bo_get_from_cache(struct drm_device *dev,
 	uint32_t page_index = bo_page_index(size);
 	struct vc4_bo *bo = NULL;
 
-	size = roundup(size, PAGE_SIZE);
-
 	mutex_lock(&vc4->bo_lock);
 	if (page_index >= vc4->bo_cache.size_list_size)
 		goto out;
Signature · 1 line
2.33.1
#1 lore raw

Re: (subset) [PATCH] drm/vc4: remove redundant assignment of variable size

Quoted 9 lines · Colin Ian King

The variable 'size' is being assigned a value that is never read, the assignment is redundant and can be removed. Cleans up clang-scan warning:

drivers/gpu/drm/vc4/vc4_bo.c:358:2: warning: Value stored to 'size' is never read [deadcode.DeadStores]

        size = roundup(size, PAGE_SIZE);

[...]

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime