* [PATCH] drm/qxl: remove variable count
@ 2023-04-08 16:50 Tom Rix
2023-04-18 20:09 ` Nick Desaulniers
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-04-08 16:50 UTC (permalink / raw)
To: airlied, kraxel, airlied, daniel, nathan, ndesaulniers
Cc: virtualization, spice-devel, dri-devel, linux-kernel, llvm,
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.
Signed-off-by: Tom Rix <trix@redhat.com>
---
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);
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] drm/qxl: remove variable count
2023-04-08 16:50 [PATCH] drm/qxl: remove variable count Tom Rix
@ 2023-04-18 20:09 ` Nick Desaulniers
0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2023-04-18 20:09 UTC (permalink / raw)
To: Tom Rix
Cc: airlied, kraxel, airlied, daniel, nathan, virtualization,
spice-devel, dri-devel, linux-kernel, llvm
On Sat, Apr 8, 2023 at 9:50 AM Tom Rix <trix@redhat.com> wrote:
>
> 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)")
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> 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);
> --
> 2.27.0
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-18 20:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-08 16:50 [PATCH] drm/qxl: remove variable count Tom Rix
2023-04-18 20:09 ` Nick Desaulniers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox