Skip to contentSkip to conversation

capabilities:: annotate implicit fall through

PATCH In review Mathieu Malaterre 3 participants 3 messages Jan 14, 2019 – Jan 23, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 capabilities:: annotate implicit fall through

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

In this particular case change put the fall through comment on a single line so as to match the regular expression expected by GCC.

This commit remove the following warning:

kernel/capability.c:95:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 kernel/capability.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/capability.c +1 -3
index 1e1c0236f55b..e60be18b98e2 100644
@@ -93,9 +93,7 @@ static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy)
 		break;
 	case _LINUX_CAPABILITY_VERSION_2:
 		warn_deprecated_v2();
-		/*
-		 * fall through - v3 is otherwise equivalent to v2.
-		 */
+		/* fall through - v3 is otherwise equivalent to v2. */
 	case _LINUX_CAPABILITY_VERSION_3:
 		*tocopy = _LINUX_CAPABILITY_U32S_3;
 		break;
Signature · 1 line
2.19.2
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

In this particular case change put the fall through comment on a single line so as to match the regular expression expected by GCC.

This commit remove the following warning:

kernel/capability.c:95:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Thanks

Quoted 20 lines
---
  kernel/capability.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
kernel/capability.c +1 -3
index 1e1c0236f55b..e60be18b98e2 100644
@@ -93,9 +93,7 @@ static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy)
  		break;
  	case _LINUX_CAPABILITY_VERSION_2:
  		warn_deprecated_v2();
-		/*
-		 * fall through - v3 is otherwise equivalent to v2.
-		 */
+		/* fall through - v3 is otherwise equivalent to v2. */
  	case _LINUX_CAPABILITY_VERSION_3:
  		*tocopy = _LINUX_CAPABILITY_U32S_3;
  		break;
maintainer
#2 lore raw
In reply to Mathieu Malaterre
Quoted 11 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

In this particular case change put the fall through comment on a single line so as to match the regular expression expected by GCC.

This commit remove the following warning:

kernel/capability.c:95:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general

Signature · 2 lines
James Morris
<[email protected]>