* drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set but not used
@ 2024-03-26 18:04 Miguel Ojeda
2024-03-27 7:59 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2024-03-26 18:04 UTC (permalink / raw)
To: Dave Airlie, Gerd Hoffmann
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Daniel Vetter, virtualization, spice-devel, dri-devel,
linux-kernel
Hi,
In today's next, I got:
drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set
but not used [-Werror,-Wunused-but-set-variable]
`count` seems to be there since commit f64122c1f6ad ("drm: add new QXL
driver. (v1.4)").
Untested diff below -- if you want a formal patch, please let me know.
Cheers,
Miguel
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set but not used
2024-03-26 18:04 drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set but not used Miguel Ojeda
@ 2024-03-27 7:59 ` Maxime Ripard
2024-03-27 14:43 ` Miguel Ojeda
0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2024-03-27 7:59 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Dave Airlie, Gerd Hoffmann, Maarten Lankhorst, Thomas Zimmermann,
David Airlie, Daniel Vetter, virtualization, spice-devel,
dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]
Hi Miguel,
On Tue, Mar 26, 2024 at 07:04:34PM +0100, Miguel Ojeda wrote:
> Hi,
>
> In today's next, I got:
>
> drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set
> but not used [-Werror,-Wunused-but-set-variable]
>
> `count` seems to be there since commit f64122c1f6ad ("drm: add new QXL
> driver. (v1.4)").
>
> Untested diff below -- if you want a formal patch, please let me know.
>
> Cheers,
> Miguel
>
> 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);
>
It looks reasonable to me, can you send a formal patch?
Thanks!
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set but not used
2024-03-27 7:59 ` Maxime Ripard
@ 2024-03-27 14:43 ` Miguel Ojeda
2024-03-27 18:12 ` Miguel Ojeda
0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2024-03-27 14:43 UTC (permalink / raw)
To: Maxime Ripard
Cc: Dave Airlie, Gerd Hoffmann, Maarten Lankhorst, Thomas Zimmermann,
David Airlie, Daniel Vetter, virtualization, spice-devel,
dri-devel, linux-kernel
On Wed, Mar 27, 2024 at 8:59 AM Maxime Ripard <mripard@kernel.org> wrote:
>
> It looks reasonable to me, can you send a formal patch?
Will do -- I found another one when running the CI with the above one fixed:
drivers/gpu/drm/qxl/qxl_ioctl.c:148:14: error: variable
'num_relocs' set but not used [-Werror,-Wunused-but-set-variable]
I will send you one for that too then.
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set but not used
2024-03-27 14:43 ` Miguel Ojeda
@ 2024-03-27 18:12 ` Miguel Ojeda
0 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2024-03-27 18:12 UTC (permalink / raw)
To: Maxime Ripard
Cc: Dave Airlie, Gerd Hoffmann, Maarten Lankhorst, Thomas Zimmermann,
David Airlie, Daniel Vetter, virtualization, spice-devel,
dri-devel, linux-kernel
On Wed, Mar 27, 2024 at 3:43 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Will do -- I found another one when running the CI with the above one fixed:
>
> drivers/gpu/drm/qxl/qxl_ioctl.c:148:14: error: variable
> 'num_relocs' set but not used [-Werror,-Wunused-but-set-variable]
>
> I will send you one for that too then.
Done: https://lore.kernel.org/lkml/20240327175556.233126-1-ojeda@kernel.org/
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-27 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26 18:04 drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable 'count' set but not used Miguel Ojeda
2024-03-27 7:59 ` Maxime Ripard
2024-03-27 14:43 ` Miguel Ojeda
2024-03-27 18:12 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox