From patchwork Fri Dec 4 16:51:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 337763 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp583808jai; Fri, 4 Dec 2020 08:52:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6Bk1X85adOnhKBtct+e77GU/7RcydbBDihecGSUD6fBaYgpOSIQKkI0xWOu2RkVox/NAh X-Received: by 2002:a17:90a:68c3:: with SMTP id q3mr4768286pjj.135.1607100726101; Fri, 04 Dec 2020 08:52:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607100726; cv=none; d=google.com; s=arc-20160816; b=RnQLkyc50moBq8F6UyPb34FAITH0K5Okw/6GWXQ5BlCNR92PMQjV3ipbd30b3wHwsL 3+OkjMnqSg9wWqocWopgO+Hfne9Q2c6xY3bL09f9Hi3SlMYVId9QRoXKNk6T5J7X7ZMB 4MaukNLm4j+y0cePYorLKr340xUGsdrMroPI+lpFrT0m+IqF4u4IBcVG86vsEpgBd7u6 ZnCFVFOuCumQ4eg3rh2eMhv3sOQr1GEKldb9nnlMxZKtsYR2pl7NDLjTsCc2wTi7wT7C D2bAG2sLsC03O5yUDcROZ1V/Q83s6CImUH7OgVPdTy8jXfVFL9UU0UEfTEtWl9g4ZdAf GxvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=oPhiQY6c9jvhOdSXZf+7JB37MWnxXFcuRmGrkWvgOLQ=; b=rf2tUlYL8gYiMMxhbeSqHu5TyozgkoLBWReHunPkRekSPIUf7pDVqrJ0UqO8jS0ew7 9JcQ2C+z4NBcVLFSUP++RkFEXqX5E1Uq5tCzTIhHz8ToysUleQ1b7v2KKuZvN3UKoLAJ dlVpPppPmI4tlyVhuUp113oo7Smv3LNn9/V/nYryUTlI3OyepJ5Nx0Joie2MSLU1R/I4 grkYd0DcICP1kRL5lyUHjtXn+uzo2T3COz0Qu/ZkFTvU2f5HjOn56UGBJPUapdLsxyTx Nu2FHtcmp68xGnoMSEtH4Q1nkgnOM1yO8v9WozyY/v6wb3jM4iUQZjIJDoPwkHYJ5AHe t+Hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id v22si2559927pjt.93.2020.12.04.08.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 08:52:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28D6A6E1B1; Fri, 4 Dec 2020 16:52:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7596F6E1B1 for ; Fri, 4 Dec 2020 16:52:03 +0000 (UTC) From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Christian Koenig , Huang Rui , David Airlie , Daniel Vetter , Dave Airlie , Madhav Chauhan Subject: [PATCH] drm/ttm: fix unused function warning Date: Fri, 4 Dec 2020 17:51:52 +0100 Message-Id: <20201204165158.3748141-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 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: , Cc: Alex Deucher , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , Martin Peres Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann ttm_pool_type_count() is not used when debugfs is disabled: drivers/gpu/drm/ttm/ttm_pool.c:243:21: error: unused function 'ttm_pool_type_count' [-Werror,-Wunused-function] static unsigned int ttm_pool_type_count(struct ttm_pool_type *pt) Move the definition into the #ifdef block. Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/ttm/ttm_pool.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) -- 2.27.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Martin Peres Reviewed-by: Christian König diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 5455b2044759..7b2f60616750 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -239,21 +239,6 @@ static struct page *ttm_pool_type_take(struct ttm_pool_type *pt) return p; } -/* Count the number of pages available in a pool_type */ -static unsigned int ttm_pool_type_count(struct ttm_pool_type *pt) -{ - unsigned int count = 0; - struct page *p; - - spin_lock(&pt->lock); - /* Only used for debugfs, the overhead doesn't matter */ - list_for_each_entry(p, &pt->pages, lru) - ++count; - spin_unlock(&pt->lock); - - return count; -} - /* Initialize and add a pool type to the global shrinker list */ static void ttm_pool_type_init(struct ttm_pool_type *pt, struct ttm_pool *pool, enum ttm_caching caching, unsigned int order) @@ -543,6 +528,20 @@ void ttm_pool_fini(struct ttm_pool *pool) EXPORT_SYMBOL(ttm_pool_fini); #ifdef CONFIG_DEBUG_FS +/* Count the number of pages available in a pool_type */ +static unsigned int ttm_pool_type_count(struct ttm_pool_type *pt) +{ + unsigned int count = 0; + struct page *p; + + spin_lock(&pt->lock); + /* Only used for debugfs, the overhead doesn't matter */ + list_for_each_entry(p, &pt->pages, lru) + ++count; + spin_unlock(&pt->lock); + + return count; +} /* Dump information about the different pool types */ static void ttm_pool_debugfs_orders(struct ttm_pool_type *pt,