summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch')
-rw-r--r--meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch124
1 files changed, 0 insertions, 124 deletions
diff --git a/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch b/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
deleted file mode 100644
index 0bd556d437..0000000000
--- a/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
+++ /dev/null
@@ -1,124 +0,0 @@
1From 0c2c8ae6b3a1fb0f611f9795953a7a6ed06be38d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 19 Apr 2017 12:04:15 -0700
4Subject: [PATCH] Add a comment to indicate valid fallthrough
5
6gcc7 warns about code with fallthroughs, this patch adds
7the comment to indicate a valid fallthrough, helps gcc7
8compiler warnings
9
10This works in cross and native compilation case
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Upstream-Status: Submitted
14---
15 Grow.c | 4 ++++
16 bitmap.c | 8 ++++++++
17 mdadm.c | 2 ++
18 super-intel.c | 1 +
19 util.c | 1 +
20 5 files changed, 16 insertions(+)
21
22diff --git a/Grow.c b/Grow.c
23index 4436a4d..b3116e2 100644
24--- a/Grow.c
25+++ b/Grow.c
26@@ -1447,6 +1447,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
27 switch (info->new_level) {
28 case 4:
29 delta_parity = 1;
30+ /* fallthrough */
31 case 0:
32 re->level = 4;
33 re->before.layout = 0;
34@@ -1474,10 +1475,12 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
35
36 case 4:
37 info->array.layout = ALGORITHM_PARITY_N;
38+ /* fallthrough */
39 case 5:
40 switch (info->new_level) {
41 case 0:
42 delta_parity = -1;
43+ /* fallthrough */
44 case 4:
45 re->level = info->array.level;
46 re->before.data_disks = info->array.raid_disks - 1;
47@@ -1533,6 +1536,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
48 case 4:
49 case 5:
50 delta_parity = -1;
51+ /* fallthrough */
52 case 6:
53 re->level = 6;
54 re->before.data_disks = info->array.raid_disks - 2;
55diff --git a/bitmap.c b/bitmap.c
56index e38cb96..10af328 100644
57--- a/bitmap.c
58+++ b/bitmap.c
59@@ -82,13 +82,21 @@ static inline int count_dirty_bits_byte(char byte, int num_bits)
60
61 switch (num_bits) { /* fall through... */
62 case 8: if (byte & 128) num++;
63+ /* fallthrough */
64 case 7: if (byte & 64) num++;
65+ /* fallthrough */
66 case 6: if (byte & 32) num++;
67+ /* fallthrough */
68 case 5: if (byte & 16) num++;
69+ /* fallthrough */
70 case 4: if (byte & 8) num++;
71+ /* fallthrough */
72 case 3: if (byte & 4) num++;
73+ /* fallthrough */
74 case 2: if (byte & 2) num++;
75+ /* fallthrough */
76 case 1: if (byte & 1) num++;
77+ /* fallthrough */
78 default: break;
79 }
80
81diff --git a/mdadm.c b/mdadm.c
82index 25a1abd..9843bc5 100644
83--- a/mdadm.c
84+++ b/mdadm.c
85@@ -155,6 +155,7 @@ int main(int argc, char *argv[])
86 mode == CREATE || mode == GROW ||
87 mode == INCREMENTAL || mode == MANAGE)
88 break; /* b means bitmap */
89+ /* fallthrough */
90 case Brief:
91 c.brief = 1;
92 continue;
93@@ -839,6 +840,7 @@ int main(int argc, char *argv[])
94
95 case O(INCREMENTAL,NoDegraded):
96 pr_err("--no-degraded is deprecated in Incremental mode\n");
97+ /* fallthrough */
98 case O(ASSEMBLE,NoDegraded): /* --no-degraded */
99 c.runstop = -1; /* --stop isn't allowed for --assemble,
100 * so we overload slightly */
101diff --git a/super-intel.c b/super-intel.c
102index e726987..1bc4b80 100644
103--- a/super-intel.c
104+++ b/super-intel.c
105@@ -3425,6 +3425,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
106
107 }
108 }
109+ /* fallthrough */
110 case MIGR_VERIFY:
111 /* we could emulate the checkpointing of
112 * 'sync_action=check' migrations, but for now
113diff --git a/util.c b/util.c
114index c26cf5f..61cbe23 100644
115--- a/util.c
116+++ b/util.c
117@@ -400,6 +400,7 @@ unsigned long long parse_size(char *size)
118 switch (*c) {
119 case 'K':
120 c++;
121+ /* fallthrough */
122 default:
123 s *= 2;
124 break;