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

-Wignored-attributes in arch/powerpc/platforms/embedded6xx/wii.c #989

Closed
nickdesaulniers opened this issue Apr 13, 2020 · 4 comments
Closed
Assignees
Labels
-Wignored-attributes [ARCH] powerpc This bug impacts ARCH=powerpc [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.8 This bug was fixed in Linux 5.8 [Reported-by] kbuild test robot Reported-by: kbuild test robot <lkp@intel.com>

Comments

@nickdesaulniers
Copy link
Member

nickdesaulniers commented Apr 13, 2020

via 0day bot:

>> arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
           if (!machine_is(wii))
                ^
   arch/powerpc/include/asm/machdep.h:248:19: note: expanded from macro 'machine_is'
                           __attribute__((weak));           \
                                          ^
   arch/powerpc/platforms/embedded6xx/wii.c:175:1: note: previous definition is here
   define_machine(wii) {
   ^
   arch/powerpc/include/asm/machdep.h:243:23: note: expanded from macro 'define_machine'
           struct machdep_calls mach_##name __machine_desc =
                                ^
   <scratch space>:89:1: note: expanded from here
   mach_wii
   ^

The attribute in on the wrong side of a declaration

@nickdesaulniers nickdesaulniers added good first issue Good for newcomers [BUG] linux A bug that should be fixed in the mainline kernel. [ARCH] powerpc This bug impacts ARCH=powerpc -Wignored-attributes [Reported-by] kbuild test robot Reported-by: kbuild test robot <lkp@intel.com> labels Apr 13, 2020
@nathanchance nathanchance self-assigned this Apr 13, 2020
@nathanchance
Copy link
Member

nathanchance commented Apr 13, 2020

@nathanchance nathanchance added [PATCH] Submitted A patch has been submitted for review and removed good first issue Good for newcomers labels Apr 13, 2020
ruscur pushed a commit to ruscur/linux that referenced this issue Apr 14, 2020
A 0day randconfig uncovered an error with clang, trimmed for brevity:

arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute
declaration must precede definition [-Werror,-Wignored-attributes]
        if (!machine_is(wii))
             ^

The macro machine_is declares mach_##name but define_machine actually
defines mach_##name, hence the warning.

To fix this, move define_machine after the is_machine usage.

Fixes: 5a7ee31 ("powerpc: wii: platform support")
Reported-by: kbuild test robot <lkp@intel.com>
Link: ClangBuiltLinux#989
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
ruscur pushed a commit to ruscur/linux that referenced this issue May 26, 2020
A 0day randconfig uncovered an error with clang, trimmed for brevity:

arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute
declaration must precede definition [-Werror,-Wignored-attributes]
        if (!machine_is(wii))
             ^

The macro machine_is declares mach_##name but define_machine actually
defines mach_##name, hence the warning.

To fix this, move define_machine after the machine_is usage.

Fixes: 5a7ee31 ("powerpc: wii: platform support")
Reported-by: kbuild test robot <lkp@intel.com>
Link: ClangBuiltLinux#989
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
@nathanchance
Copy link
Member

nathanchance commented May 28, 2020

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels May 28, 2020
mpe pushed a commit to linuxppc/linux that referenced this issue Jun 2, 2020
A 0day randconfig uncovered an error with clang, trimmed for brevity:

arch/powerpc/platforms/embedded6xx/wii.c:195:7: error: attribute
declaration must precede definition [-Werror,-Wignored-attributes]
        if (!machine_is(wii))
             ^

The macro machine_is declares mach_##name but define_machine actually
defines mach_##name, hence the warning.

To fix this, move define_machine after the is_machine usage.

Fixes: 5a7ee31 ("powerpc: wii: platform support")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: ClangBuiltLinux#989
Link: https://lore.kernel.org/r/20200413190644.16757-1-natechancellor@gmail.com
@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Jun 3, 2020

not yet in mainline

@nathanchance
Copy link
Member

nathanchance commented Jun 6, 2020

Merged into mainline: https://git.kernel.org/linus/91ffeaa7e5dd62753e23a1204dc7ecd11f26eadc

@nathanchance nathanchance added [FIXED][LINUX] 5.8 This bug was fixed in Linux 5.8 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wignored-attributes [ARCH] powerpc This bug impacts ARCH=powerpc [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.8 This bug was fixed in Linux 5.8 [Reported-by] kbuild test robot Reported-by: kbuild test robot <lkp@intel.com>
Projects
None yet
Development

No branches or pull requests

2 participants