summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/asix
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2021-10-26 00:12:38 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-26 16:57:23 +0300
commit3c5548812a0cf536b98f8d9f7f9377bd304809c1 (patch)
tree976833950c68496af13f1d23a4e2540330c2e5f3 /drivers/net/ethernet/asix
parenta137c069fbc1972bdaf2dd6c75083cd2f3e6e3d7 (diff)
downloadlinux-3c5548812a0cf536b98f8d9f7f9377bd304809c1.tar.xz
net: ax88796c: Fix clang -Wimplicit-fallthrough in ax88796c_set_mac()
Clang warns: drivers/net/ethernet/asix/ax88796c_main.c:696:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] case SPEED_10: ^ drivers/net/ethernet/asix/ax88796c_main.c:696:2: note: insert 'break;' to avoid fall-through case SPEED_10: ^ break; drivers/net/ethernet/asix/ax88796c_main.c:706:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] case DUPLEX_HALF: ^ drivers/net/ethernet/asix/ax88796c_main.c:706:2: note: insert 'break;' to avoid fall-through case DUPLEX_HALF: ^ break; Clang is a little more pedantic than GCC, which permits implicit fallthroughs to cases that contain 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 breaks to fix the warning. Link: https://github.com/ClangBuiltLinux/linux/issues/1491 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/asix')
-rw-r--r--drivers/net/ethernet/asix/ax88796c_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c
index 91fa0499ea6a..3f25fafd422e 100644
--- a/drivers/net/ethernet/asix/ax88796c_main.c
+++ b/drivers/net/ethernet/asix/ax88796c_main.c
@@ -693,6 +693,7 @@ static void ax88796c_set_mac(struct ax88796c_device *ax_local)
switch (ax_local->speed) {
case SPEED_100:
maccr |= MACCR_SPEED_100;
+ break;
case SPEED_10:
case SPEED_UNKNOWN:
break;
@@ -703,6 +704,7 @@ static void ax88796c_set_mac(struct ax88796c_device *ax_local)
switch (ax_local->duplex) {
case DUPLEX_FULL:
maccr |= MACCR_SPEED_100;
+ break;
case DUPLEX_HALF:
case DUPLEX_UNKNOWN:
break;