From patchwork Wed Jul 26 10:12:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: wangzhu X-Patchwork-Id: 13329014 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 AEB0AC00528 for ; Thu, 27 Jul 2023 07:12:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B08F010E4FC; Thu, 27 Jul 2023 07:12:06 +0000 (UTC) X-Greylist: delayed 356 seconds by postgrey-1.36 at gabe; Wed, 26 Jul 2023 10:13:00 UTC Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC67710E1D2 for ; Wed, 26 Jul 2023 10:13:00 +0000 (UTC) Received: from dggpeml500025.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R9qRv3XjHzVjv3; Wed, 26 Jul 2023 18:11:23 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.202) by dggpeml500025.china.huawei.com (7.185.36.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 26 Jul 2023 18:12:57 +0800 From: Zhu Wang To: , , , , , , , , Subject: [PATCH -next] drm/radeon: fix -Wunused-but-set-variable warning Date: Wed, 26 Jul 2023 18:12:22 +0800 Message-ID: <20230726101222.168710-1-wangzhu9@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.202] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500025.china.huawei.com (7.185.36.35) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 27 Jul 2023 07:11:21 +0000 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: , Cc: wangzhu9@huawei.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When building with W=1, the following warning occurs. drivers/gpu/drm/radeon/radeon_ttm.c:200:20: warning: variable ‘rbo’ set but not used [-Wunused-but-set-variable] struct radeon_bo *rbo; The variable 'rbo' is used only in WARN_ON_ONCE in the function radeon_bo_move, and WARN_ON_ONCE is removed in the following patch, so we removed 'rbo' to remove the -Wunused-but-set-variable warning. Fixes: f87c1f0b7b79 ("drm/ttm: prevent moving of pinned BOs") Signed-off-by: Zhu Wang --- drivers/gpu/drm/radeon/radeon_ttm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 4eb83ccc4906..de4e6d78f1e1 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -197,7 +197,6 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, { struct ttm_resource *old_mem = bo->resource; struct radeon_device *rdev; - struct radeon_bo *rbo; int r; if (new_mem->mem_type == TTM_PL_TT) { @@ -210,7 +209,6 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, if (r) return r; - rbo = container_of(bo, struct radeon_bo, tbo); rdev = radeon_get_rdev(bo->bdev); if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL)) {