Reland: Clean up implicit fall through.

Directly use the __attribute__ ((fallthrough)) instead of
a macro.
This was suggested in CL:1772474.

BUG=chromium:997709
TEST=CQ
BRANCH=None

Change-Id: Ifcdcd3822eddea41aeb88f4a55bd09aa483f6054
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2031766
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index 0e49576..5470d2a 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -71,27 +71,6 @@
 #endif
 #endif
 
-// Have a generic fall-through for different versions of C/C++.
-// Taken from boringssl.
-#if defined(__cplusplus) && __cplusplus >= 201703L
-#define VBOOT_FALLTHROUGH [[fallthrough]]
-#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__)
-#define VBOOT_FALLTHROUGH [[clang::fallthrough]]
-#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \
-    __GNUC__ >= 7
-#define VBOOT_FALLTHROUGH [[gnu::fallthrough]]
-#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7
-#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
-#elif defined(__clang__)
-#if __has_attribute(fallthrough)
-#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
-#else // clang versions that do not support fallthrough.
-#define VBOOT_FALLTHROUGH
-#endif
-#else // C++11 on gcc 6, and all other cases
-#define VBOOT_FALLTHROUGH
-#endif
-
 /**
  * Round up a number to a multiple of VB2_WORKBUF_ALIGN
  *
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c
index 7803a7e..db704b5 100644
--- a/firmware/lib/cgptlib/cgptlib.c
+++ b/firmware/lib/cgptlib/cgptlib.c
@@ -143,8 +143,8 @@
 			break;
 		}
 		/* Out of tries, so drop through and mark partition bad. */
+		__attribute__ ((fallthrough));
 	}
-	VBOOT_FALLTHROUGH;
 	case GPT_UPDATE_ENTRY_BAD: {
 		/* Giving up on this partition entirely. */
 		if (!GetEntrySuccessful(e)) {
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 24b63c4..5139ba3 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -353,7 +353,7 @@
 
 	default:
 		VB2_DEBUG("unknown commit error: %#x\n", rv);
-		VBOOT_FALLTHROUGH;
+		__attribute__ ((fallthrough));
 
 	case VB2_ERROR_NV_WRITE:
 		if (!(ctx->flags & VB2_CONTEXT_RECOVERY_MODE))
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index 55b09e9..debe2a8 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -260,7 +260,7 @@
 			return VB2_SUCCESS;
 		case 'a'...'z':
 			key = toupper(key);
-			VBOOT_FALLTHROUGH;
+			__attribute__ ((fallthrough));
 		case '0'...'9':
 		case 'A'...'Z':
 			if ((len > 0 && is_vowel(key)) ||
@@ -585,7 +585,7 @@
 			/* Only disable virtual dev switch if allowed by GBB */
 			if (!(gbb->flags & VB2_GBB_FLAG_ENTER_TRIGGERS_TONORM))
 				break;
-			VBOOT_FALLTHROUGH;
+			__attribute__ ((fallthrough));
 		case ' ':
 			/* See if we should disable virtual dev-mode switch. */
 			VB2_DEBUG("sd->flags=%#x\n", sd->flags);
diff --git a/futility/cmd_dump_fmap.c b/futility/cmd_dump_fmap.c
index ef46ffc..48f9185 100644
--- a/futility/cmd_dump_fmap.c
+++ b/futility/cmd_dump_fmap.c
@@ -444,7 +444,7 @@
 			break;
 		case 'H':
 			opt_gaps = 1;
-			VBOOT_FALLTHROUGH;
+			__attribute__ ((fallthrough));
 		case 'h':
 			opt_format = FMT_HUMAN;
 			opt_overlap++;
@@ -507,7 +507,7 @@
 		case FMT_NORMAL:
 			printf("hit at 0x%08x\n",
 			       (uint32_t) ((char *)fmap - (char *)base_of_rom));
-			VBOOT_FALLTHROUGH;
+			__attribute__ ((fallthrough));
 		default:
 			retval = normal_fmap(fmap,
 					     argc - optind - 1,
diff --git a/futility/cmd_sign.c b/futility/cmd_sign.c
index c69f712..117a653 100644
--- a/futility/cmd_sign.c
+++ b/futility/cmd_sign.c
@@ -719,7 +719,7 @@
 			break;
 		case OPT_FV:
 			sign_option.fv_specified = 1;
-			VBOOT_FALLTHROUGH;
+			__attribute__ ((fallthrough));
 		case OPT_INFILE:
 			sign_option.inout_file_count++;
 			infile = optarg;
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 94baf66..3c429bb 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -413,7 +413,7 @@
 			break;
 		case VDAT_INT_FW_BOOT2:
 			value = (sh->flags & VBSD_BOOT_FIRMWARE_VBOOT2 ? 1 : 0);
-			VBOOT_FALLTHROUGH;
+			__attribute__ ((fallthrough));
 		default:
 			break;
 	}