From patchwork Mon Feb 26 03:59:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiapeng Chong X-Patchwork-Id: 13571277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5EAFC48BF6 for ; Mon, 26 Feb 2024 03:59:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6ED310EDD6; Mon, 26 Feb 2024 03:59:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="fqk4M5Xe"; dkim-atps=neutral Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id D405710EDD6 for ; Mon, 26 Feb 2024 03:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1708919981; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=UXXJovU2AesrIYqdlrvFTpqhm0SaeJKemqLy2O2LCkE=; b=fqk4M5Xe/o9QPDoSG5qKoiv1sJ8i8iEbEmK1pcSd3A+aCOmN6+ExfiQsjsf0aCaTlbgtnd3nBsq6MM3N27QvVM8/HhJS/XoyRQMzEpRM4i1sZyJBVMLf4CU6dBdJ8BSsA2rGeYm/fqjRncflODjFno3dcvwyhAG0SkWIm9mg5Fc= X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R711e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045170; MF=jiapeng.chong@linux.alibaba.com; NM=1; PH=DS; RN=13; SR=0; TI=SMTPD_---0W1AMyXd_1708919967; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0W1AMyXd_1708919967) by smtp.aliyun-inc.com; Mon, 26 Feb 2024 11:59:40 +0800 From: Jiapeng Chong To: airlied@redhat.com Cc: kraxel@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] drm/qxl: remove redundant code Date: Mon, 26 Feb 2024 11:59:26 +0800 Message-Id: <20240226035926.102859-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Variable num_relocs is not effectively used, so delete it. Having two labels seems somewhat redundant; the 'out_free_release' can be removed, leaving 'out_free_bos'. drivers/gpu/drm/qxl/qxl_ioctl.c:148:14: warning: variable 'num_relocs' set but not used. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8316 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/qxl/qxl_ioctl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index dd0f834d881c..c1dd5709d37a 100644 --- a/drivers/gpu/drm/qxl/qxl_ioctl.c +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c @@ -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) { @@ -196,11 +196,10 @@ static int qxl_process_single_command(struct qxl_device *qdev, if (unwritten) { DRM_ERROR("got unwritten %d\n", unwritten); ret = -EFAULT; - goto out_free_release; + goto out_free_bos; } /* 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) { @@ -261,7 +259,6 @@ static int qxl_process_single_command(struct qxl_device *qdev, ret = qxl_push_command_ring_release(qdev, release, cmd->type, true); out_free_bos: -out_free_release: if (ret) qxl_release_free(qdev, release); out_free_reloc: