Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wunused-const-variable in drivers/memory/tegra/tegra124.c #526

Closed
nhukc opened this issue Jun 12, 2019 · 2 comments
Closed

-Wunused-const-variable in drivers/memory/tegra/tegra124.c #526

nhukc opened this issue Jun 12, 2019 · 2 comments
Assignees
Labels
-Wunused-const-variable [ARCH] arm64 This bug impacts ARCH=arm64 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.3 This bug was fixed in Linux 5.3

Comments

@nhukc
Copy link

nhukc commented Jun 12, 2019

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[] = {
                           ^

Variable is only used within an ifdef. Moving the variable inside the ifdef seems logical.

#ifdef CONFIG_ARCH_TEGRA_124_SOC
@nhukc nhukc added [BUG] linux A bug that should be fixed in the mainline kernel. [ARCH] arm64 This bug impacts ARCH=arm64 low priority This bug is not critical and not a priority -Wunused-const-variable labels Jun 12, 2019
@nhukc nhukc self-assigned this Jun 12, 2019
@nhukc nhukc added the [PATCH] Submitted A patch has been submitted for review label Jun 13, 2019
@nhukc
Copy link
Author

nhukc commented Jun 13, 2019

@nhukc nhukc added the [PATCH] Accepted A submitted patch has been accepted upstream label Jun 14, 2019
@nickdesaulniers nickdesaulniers removed [PATCH] Submitted A patch has been submitted for review labels Jun 17, 2019
jessfraz pushed a commit to jessfraz/linux that referenced this issue Jun 18, 2019
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: ClangBuiltLinux/linux#526
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
@nickdesaulniers nickdesaulniers added [FIXED][LINUX] 5.3 This bug was fixed in Linux 5.3 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Jul 21, 2019
@tpimh tpimh removed the low priority This bug is not critical and not a priority label Sep 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wunused-const-variable [ARCH] arm64 This bug impacts ARCH=arm64 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.3 This bug was fixed in Linux 5.3
Projects
None yet
Development

No branches or pull requests

3 participants