aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge/amd/agesa
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-07-12 10:34:06 -0600
committerPatrick Georgi <pgeorgi@google.com>2019-07-19 09:57:54 +0000
commit4c33a3aaa38c94b103c51aa6a5553a4b1355c435 (patch)
tree57b215944720d992ea1ded6bdd774d79411a687f /src/southbridge/amd/agesa
parent78107939de6e2c4b66de6bd1370607f7d3a600f0 (diff)
src: Make implicit fall throughs explicit
Implicit fall throughs are a perpetual source of bugs and Coverity Scan issues, so let's squash them once and for all. GCC can flag implicit fall throughs using the -Wimplicit-fallthrough warning, and this should ensure no more enter the code base. However, many fall throughs are intentional, and we can use the following comment style to have GCC suppress the warning. switch (x) { case 1: y += 1; /* fall through */ case 2: y += 2; /* fall through - but this time with an explanation */ default: y += 3; } This patch adds comments for all remaining intentional fall throughs, and tweaks some existing fall through comments to fit the syntax that GCC expects. Change-Id: I1d75637a434a955a58d166ad203e49620d7395ed Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34297 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Diffstat (limited to 'src/southbridge/amd/agesa')
-rw-r--r--src/southbridge/amd/agesa/hudson/hudson.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/southbridge/amd/agesa/hudson/hudson.c b/src/southbridge/amd/agesa/hudson/hudson.c
index 25997d2e9d..4c06e87281 100644
--- a/src/southbridge/amd/agesa/hudson/hudson.c
+++ b/src/southbridge/amd/agesa/hudson/hudson.c
@@ -117,21 +117,24 @@ void hudson_enable(struct device *dev)
case PCI_DEVFN(0x12, 0):
if (dev->enabled == 0)
hudson_disable_usb(USB_EN_DEVFN_12_0);
- case PCI_DEVFN(0x12, 2): /* Fall through */
+ /* fall through */
+ case PCI_DEVFN(0x12, 2):
if (dev->enabled == 0)
hudson_disable_usb(USB_EN_DEVFN_12_2);
break;
case PCI_DEVFN(0x13, 0):
if (dev->enabled == 0)
hudson_disable_usb(USB_EN_DEVFN_13_0);
- case PCI_DEVFN(0x13, 2): /* Fall through */
+ /* fall through */
+ case PCI_DEVFN(0x13, 2):
if (dev->enabled == 0)
hudson_disable_usb(USB_EN_DEVFN_13_2);
break;
case PCI_DEVFN(0x16, 0):
if (dev->enabled == 0)
hudson_disable_usb(USB_EN_DEVFN_16_0);
- case PCI_DEVFN(0x16, 2): /* Fall through */
+ /* fall through */
+ case PCI_DEVFN(0x16, 2):
if (dev->enabled == 0)
hudson_disable_usb(USB_EN_DEVFN_16_2);
break;