Skip to content

Commit aba2a14

Browse files
ojedamripard
authored andcommitted
drm/qxl: remove unused variable from qxl_process_single_command()
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 74d9a63 ("drm/qxl: Simplify cleaning qxl processing command") removed the use that happened in that label. Thus remove the unused variable. Fixes: 74d9a63 ("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>
1 parent 7cd78fd commit aba2a14

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/gpu/drm/qxl/qxl_ioctl.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int qxl_process_single_command(struct qxl_device *qdev,
145145
struct qxl_release *release;
146146
struct qxl_bo *cmd_bo;
147147
void *fb_cmd;
148-
int i, ret, num_relocs;
148+
int i, ret;
149149
int unwritten;
150150

151151
switch (cmd->type) {
@@ -200,7 +200,6 @@ static int qxl_process_single_command(struct qxl_device *qdev,
200200
}
201201

202202
/* fill out reloc info structs */
203-
num_relocs = 0;
204203
for (i = 0; i < cmd->relocs_num; ++i) {
205204
struct drm_qxl_reloc reloc;
206205
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,
230229
reloc_info[i].dst_bo = cmd_bo;
231230
reloc_info[i].dst_offset = reloc.dst_offset + release->release_offset;
232231
}
233-
num_relocs++;
234232

235233
/* reserve and validate the reloc dst bo */
236234
if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle) {

0 commit comments

Comments
 (0)