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

-Wimplicit-fallthrough in drivers/hwmon/tmp401.c #1505

Closed
nathanchance opened this issue Nov 16, 2021 · 1 comment
Closed

-Wimplicit-fallthrough in drivers/hwmon/tmp401.c #1505

nathanchance opened this issue Nov 16, 2021 · 1 comment
Assignees
Labels
-Wimplicit-fallthrough [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nathanchance
Copy link
Member

drivers/hwmon/tmp401.c:526:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
        default:
        ^
drivers/hwmon/tmp401.c:526:2: note: insert 'break;' to avoid fall-through
        default:
        ^
        break;
1 error generated.

Patch submitted: https://lore.kernel.org/r/20211116154438.1383290-1-nathan@kernel.org/

@nathanchance nathanchance added [PATCH] Submitted A patch has been submitted for review [BUG] linux-next This is an issue only seen in linux-next -Wimplicit-fallthrough labels Nov 16, 2021
@nathanchance nathanchance self-assigned this Nov 16, 2021
fengguang pushed a commit to 0day-ci/linux that referenced this issue Nov 16, 2021
Clang warns:

drivers/hwmon/tmp401.c:526:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
        default:
        ^
drivers/hwmon/tmp401.c:526:2: note: insert 'break;' to avoid fall-through
        default:
        ^
        break;
1 error generated.

Clang is a little more pedantic than GCC, which does not warn when
falling through to a case that is just break or return. Clang's version
is more in line with the kernel's own stance in deprecated.rst, which
states that all switch/case blocks must end in either break,
fallthrough, continue, goto, or return. Add the missing break to silence
the warning.

Link: ClangBuiltLinux#1505
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Submitted A patch has been submitted for review labels Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wimplicit-fallthrough [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

1 participant