Skip to contentSkip to conversation

drm/qxl: remove variable count

PATCH In review Tom Rix 2 participants 2 messages Apr 8, 2023 – Apr 18, 2023

Subsystems (4)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 drm/qxl: remove variable count

clang with W=1 reports drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable
'count' set but not used [-Werror,-Wunused-but-set-variable]

        int count = 0;
            ^

This variable is not used so remove it.

---
 drivers/gpu/drm/qxl/qxl_cmd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/qxl/qxl_cmd.c +0 -2
index 281edab518cd..d6ea01f3797b 100644
@@ -421,7 +421,6 @@ int qxl_surface_id_alloc(struct qxl_device *qdev,
 {
 	uint32_t handle;
 	int idr_ret;
-	int count = 0;
 again:
 	idr_preload(GFP_ATOMIC);
 	spin_lock(&qdev->surf_id_idr_lock);
@@ -433,7 +432,6 @@ int qxl_surface_id_alloc(struct qxl_device *qdev,
 	handle = idr_ret;
 
 	if (handle >= qdev->rom->n_surfaces) {
-		count++;
 		spin_lock(&qdev->surf_id_idr_lock);
 		idr_remove(&qdev->surf_id_idr, handle);
 		spin_unlock(&qdev->surf_id_idr_lock);
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Tom Rix

clang with W=1 reports drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable
'count' set but not used [-Werror,-Wunused-but-set-variable]

        int count = 0;
            ^

This variable is not used so remove it.

Thanks for the patch!

Fixes 64122c1f6ad ("drm: add new QXL driver. (v1.4)")
Quoted 29 lines
---
 drivers/gpu/drm/qxl/qxl_cmd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/qxl/qxl_cmd.c +0 -3
index 281edab518cd..d6ea01f3797b 100644
@@ -421,7 +421,6 @@ int qxl_surface_id_alloc(struct qxl_device *qdev,
 {
        uint32_t handle;
        int idr_ret;
-       int count = 0;
 again:
        idr_preload(GFP_ATOMIC);
        spin_lock(&qdev->surf_id_idr_lock);
@@ -433,7 +432,6 @@ int qxl_surface_id_alloc(struct qxl_device *qdev,
        handle = idr_ret;
 
        if (handle >= qdev->rom->n_surfaces) {
-               count++;
                spin_lock(&qdev->surf_id_idr_lock);
                idr_remove(&qdev->surf_id_idr, handle);
                spin_unlock(&qdev->surf_id_idr_lock);
--

2.27.0

Signature · 2 lines
Thanks,
~Nick Desaulniers