virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()`
@ 2024-03-27 17:55 Miguel Ojeda
  2024-03-27 17:55 ` [PATCH 2/2] drm/qxl: remove unused variable from `qxl_process_single_command()` Miguel Ojeda
  2024-03-27 18:14 ` [PATCH 1/2] drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()` Miguel Ojeda
  0 siblings, 2 replies; 5+ messages in thread
From: Miguel Ojeda @ 2024-03-27 17:55 UTC (permalink / raw)
  To: Dave Airlie, Gerd Hoffmann, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann
  Cc: David Airlie, Daniel Vetter, Alon Levy, Frediano Ziglio,
	Miguel Ojeda, virtualization, spice-devel, dri-devel,
	linux-kernel

Clang 14 in an (essentially) defconfig loongarch64 build for next-20240326
reports [1]:

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

The variable is already unused in the version that got into the tree.

Thus remove the unused variable.

Fixes: f64122c1f6ad ("drm: add new QXL driver. (v1.4)")
Closes: https://lore.kernel.org/lkml/CANiq72mjc5t4n25SQvYSrOEhxxpXYPZ4pPzneSJHEnc3qApu2Q@mail.gmail.com/
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
Given there is a loop going on here, it would be good to double-check whether
this variable was supposed to be used for something useful or if it was just a
remnant of a version previous to v1.4.

 drivers/gpu/drm/qxl/qxl_cmd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
index 281edab518cd..d6ea01f3797b 100644
--- a/drivers/gpu/drm/qxl/qxl_cmd.c
+++ b/drivers/gpu/drm/qxl/qxl_cmd.c
@@ -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);

base-commit: 26074e1be23143b2388cacb36166766c235feb7c
--
2.44.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-28 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 17:55 [PATCH 1/2] drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()` Miguel Ojeda
2024-03-27 17:55 ` [PATCH 2/2] drm/qxl: remove unused variable from `qxl_process_single_command()` Miguel Ojeda
2024-03-27 18:14 ` [PATCH 1/2] drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()` Miguel Ojeda
2024-03-28 10:18   ` Maxime Ripard
2024-03-28 14:07     ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).