Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp53200ybi; Thu, 13 Jun 2019 11:28:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRQMBDIRjUV6vdSTKNJaGPy8Re9VkIrEvW45n9qLarqZF5GdhojxGYCf9QZu4yX8D66dAE X-Received: by 2002:a17:90a:778c:: with SMTP id v12mr4265604pjk.141.1560450526528; Thu, 13 Jun 2019 11:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560450526; cv=none; d=google.com; s=arc-20160816; b=nR6+7TYswlEOxOkqP94ITqn/TykI6HCFfFA/M9q15LFqWN6fqpruQtjnLVA7cBaJrO ZeR3+Tcf9XmUlVyfDvqlfobReMx855w5DBiIfJoZssku4d02QC5rWVkHIqKlqIb72bxh LIpK5gwsux8QH1NWwvAgmBU4NWvDLMMvBHiPK0S/Gymk44KHVoW4V3bPKsurc2zdCnSd TuA0/cof2mKhrXb0AIDxIrcuoI834XZTHTU4kklfDXxu1JbXOEOoDIozeu50yjNSd36o 1UdpTon0NmF0yQZDqjtrncdCvRLuoQIqwZ0AJq37fl6BNKYld+yWwkD//GBSArMcWG8k K/oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=ffhihfkZ6rU48da7c4itXkMX6+7iKvBZxVtyPBW0dvg=; b=zUYwfns907KD+JVzgkJZB1Ax6sYgSSO7dg9ush3sZ/66dxUi4wZFZzbvkR/KrzELfM r45atKe3A7Sha2WS0Z6Ad9Sxdbjlf9/+iB7YXI3JOJhROOaq9tjlpEcqrUz+PIczRrbV DnCU5hgF4Q5pSX6rYJmzjaLnDhIAi3IRs5HzH2rjiFMY++7YNM7GoWVB6gbOWzlizB7O xDl2WO7Ch+S06Yxr2fKPAi1pFUUd5M8XsHD6vUkI45CWDroye5MUJ+zDPgwVj9z2qBhH 9LQq7SUuYIhNqvxAYXPLvc8WR3MF6EBt/XnPbWM6u5MIk3oI3TXXRPWlEUxhFh//qzVu EiGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JBRxYDcT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si309554pjt.79.2019.06.13.11.28.31; Thu, 13 Jun 2019 11:28:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JBRxYDcT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728334AbfFMS0s (ORCPT + 99 others); Thu, 13 Jun 2019 14:26:48 -0400 Received: from mail-oi1-f201.google.com ([209.85.167.201]:36897 "EHLO mail-oi1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727314AbfFMS0r (ORCPT ); Thu, 13 Jun 2019 14:26:47 -0400 Received: by mail-oi1-f201.google.com with SMTP id f19so7184560oib.4 for ; Thu, 13 Jun 2019 11:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ffhihfkZ6rU48da7c4itXkMX6+7iKvBZxVtyPBW0dvg=; b=JBRxYDcTsltAW0dCoEwLXWjwsQt5Z/2JzGjYnbuj4qxFmq4LeZ7O2J1p5udBWrIF9S PJAVTo3ZWkYDdRJZMsvZkPvaEslKeCCPjBZpty3RVyQ7M9exVSP//dA4iOHRG+FiiNbO 42e9XnCYO9ibWz3JcdlFyMR3pTapZqrnET0uWPzzP8mfXeHZ0+ylBV8jOvEqqgxWQy7G X+VZYMQ0Eno/CVI0bOoacAWsTfjYlnMTRYQStVNpdMt5g+/GvXTxEX5gj+YCMXQ1ekLI PLtkDq0UbdXc0+QyPRYfT+priqT8WF8ABTIyCe63mvUA2htlCHDYnMp2bVW5M3o7zwQF 17Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ffhihfkZ6rU48da7c4itXkMX6+7iKvBZxVtyPBW0dvg=; b=C9M2ncIkmJGeYh1L3xCasjXswSqmQgTxxllYCFoqVIj4KIc7aTRZQqjc4xVKCCrDLc b8cISVGB4S1Djp8pwTZNAGMhQ6/glkNifYpaRnqG+DkSXgVTDZUQp+nrBmVk6oD7yBso tcfE1Ikk2cA+ZdYpEaA/4wvUK8lwF+50N9GC/cHwfIZ6kRyCdKzhhL7B4RP9pe0XZIfp pUAu8MQYmnslyvRsdJI2U9D40AnKRBU3jntH/eBtNf4SeT3Av85o9Kcx4wo93LnsZekN 4OE+lKx22nmhnFb6slj6veP/abB9w4IyuD8gw40vulHiA91RH8cnM/C69GSsqOSPjY9G wMkQ== X-Gm-Message-State: APjAAAVtZ464cbTNGEkq2bMOGuytaqBxQyYhk3UNUNGWWBVLTuwiAm8J lz1BP7Qkp9JlsH+Db0JrjwCZS32/Fw== X-Received: by 2002:a9d:6a5a:: with SMTP id h26mr31490210otn.319.1560450406919; Thu, 13 Jun 2019 11:26:46 -0700 (PDT) Date: Thu, 13 Jun 2019 11:26:10 -0700 In-Reply-To: Message-Id: <20190613182610.238801-1-nhuck@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog Subject: [PATCH v2] memory: tegra: Fix -Wunused-const-variable From: Nathan Huckleberry To: thierry.reding@gmail.com, jonathanh@nvidia.com Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Huckleberry , clang-built-linux@googlegroups.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang produces the following warning drivers/memory/tegra/tegra124.c:36:28: warning: unused variable 'tegra124_mc_emem_regs' [-Wunused-const-variable] static const unsigned long tegra124_mc_emem_regs[] = { ^ The only usage of this variable is from within an ifdef. It seems logical to move the variable into the ifdef as well. Cc: clang-built-linux@googlegroups.com Link: https://github.com/ClangBuiltLinux/linux/issues/526 Signed-off-by: Nathan Huckleberry --- Changes from v1 -> v2: * Moved definition of tegra124_mc_emem_regs into existing ifdef drivers/memory/tegra/tegra124.c | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c index 8f8487bda642..6985a4e33325 100644 --- a/drivers/memory/tegra/tegra124.c +++ b/drivers/memory/tegra/tegra124.c @@ -33,28 +33,6 @@ #define MC_EMEM_ARB_MISC1 0xdc #define MC_EMEM_ARB_RING1_THROTTLE 0xe0 -static const unsigned long tegra124_mc_emem_regs[] = { - MC_EMEM_ARB_CFG, - MC_EMEM_ARB_OUTSTANDING_REQ, - MC_EMEM_ARB_TIMING_RCD, - MC_EMEM_ARB_TIMING_RP, - MC_EMEM_ARB_TIMING_RC, - MC_EMEM_ARB_TIMING_RAS, - MC_EMEM_ARB_TIMING_FAW, - MC_EMEM_ARB_TIMING_RRD, - MC_EMEM_ARB_TIMING_RAP2PRE, - MC_EMEM_ARB_TIMING_WAP2PRE, - MC_EMEM_ARB_TIMING_R2R, - MC_EMEM_ARB_TIMING_W2W, - MC_EMEM_ARB_TIMING_R2W, - MC_EMEM_ARB_TIMING_W2R, - MC_EMEM_ARB_DA_TURNS, - MC_EMEM_ARB_DA_COVERS, - MC_EMEM_ARB_MISC0, - MC_EMEM_ARB_MISC1, - MC_EMEM_ARB_RING1_THROTTLE -}; - static const struct tegra_mc_client tegra124_mc_clients[] = { { .id = 0x00, @@ -1049,6 +1027,28 @@ static const struct tegra_mc_reset tegra124_mc_resets[] = { }; #ifdef CONFIG_ARCH_TEGRA_124_SOC +static const unsigned long tegra124_mc_emem_regs[] = { + MC_EMEM_ARB_CFG, + MC_EMEM_ARB_OUTSTANDING_REQ, + MC_EMEM_ARB_TIMING_RCD, + MC_EMEM_ARB_TIMING_RP, + MC_EMEM_ARB_TIMING_RC, + MC_EMEM_ARB_TIMING_RAS, + MC_EMEM_ARB_TIMING_FAW, + MC_EMEM_ARB_TIMING_RRD, + MC_EMEM_ARB_TIMING_RAP2PRE, + MC_EMEM_ARB_TIMING_WAP2PRE, + MC_EMEM_ARB_TIMING_R2R, + MC_EMEM_ARB_TIMING_W2W, + MC_EMEM_ARB_TIMING_R2W, + MC_EMEM_ARB_TIMING_W2R, + MC_EMEM_ARB_DA_TURNS, + MC_EMEM_ARB_DA_COVERS, + MC_EMEM_ARB_MISC0, + MC_EMEM_ARB_MISC1, + MC_EMEM_ARB_RING1_THROTTLE +}; + static const struct tegra_smmu_soc tegra124_smmu_soc = { .clients = tegra124_mc_clients, .num_clients = ARRAY_SIZE(tegra124_mc_clients), -- 2.22.0.rc2.383.gf4fbbf30c2-goog