drm/qxl: remove unused variable from `qxl_process_single_command()`
authorMiguel Ojeda <ojeda@kernel.org>
Wed, 27 Mar 2024 17:55:56 +0000 (18:55 +0100)
committerMaxime Ripard <mripard@kernel.org>
Thu, 28 Mar 2024 10:15:48 +0000 (11:15 +0100)
Clang 14 in an (essentially) defconfig loongarch64 build for next-20240327
reports [1]:

     drivers/gpu/drm/qxl/qxl_ioctl.c:148:14: error: variable 'num_relocs'
     set but not used [-Werror,-Wunused-but-set-variable]

The variable was originally used in the `out_free_bos` label, but commit
74d9a6335dce ("drm/qxl: Simplify cleaning qxl processing command")
removed the use that happened in that label.

Thus remove the unused variable.

Fixes: 74d9a6335dce ("drm/qxl: Simplify cleaning qxl processing command")
Closes: https://lore.kernel.org/lkml/CANiq72kqqQfUxLkHJYqeBAhpc6YcX7bfR96gmmbF=j8hEOykqw@mail.gmail.com/ [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/r/20240327175556.233126-2-ojeda@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/qxl/qxl_ioctl.c

index dd0f834d881ce1b4b48249165e42bb73122d81ce..506ae1f5e099ff2a9c21989ea175d8369bda6976 100644 (file)
@@ -145,7 +145,7 @@ static int qxl_process_single_command(struct qxl_device *qdev,
        struct qxl_release *release;
        struct qxl_bo *cmd_bo;
        void *fb_cmd;
-       int i, ret, num_relocs;
+       int i, ret;
        int unwritten;
 
        switch (cmd->type) {
@@ -200,7 +200,6 @@ static int qxl_process_single_command(struct qxl_device *qdev,
        }
 
        /* fill out reloc info structs */
-       num_relocs = 0;
        for (i = 0; i < cmd->relocs_num; ++i) {
                struct drm_qxl_reloc reloc;
                struct drm_qxl_reloc __user *u = u64_to_user_ptr(cmd->relocs);
@@ -230,7 +229,6 @@ static int qxl_process_single_command(struct qxl_device *qdev,
                        reloc_info[i].dst_bo = cmd_bo;
                        reloc_info[i].dst_offset = reloc.dst_offset + release->release_offset;
                }
-               num_relocs++;
 
                /* reserve and validate the reloc dst bo */
                if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle) {