Skip to content

Commit

Permalink
vmmon: mark expected switch fall through
Browse files Browse the repository at this point in the history
Since v5.3-rc2, kernel is built with -Wimplicit-fallthrough by default
so that compiler warns about switch fall thgrough unless it is marked as
expected. Add comment to mark one existing fall through as expected.

Note: this function is no longer present in 15.1.0 and it is probably
dead code anyway as hash2() is only called from HashFunc_HashPage()
which does not seem to be called anywhere. But to keep the code as close
to upstream as reasonably possible, just mark the fall through and keep
both functions in place.
  • Loading branch information
mkubecek committed Jul 31, 2019
1 parent d20641f commit 6c9f69c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vmmon-only/include/hashFunc.h
Expand Up @@ -251,6 +251,7 @@ static INLINE ub8 hash2(register const ub8 *k, /* the key */
{
/* c is reserved for the length */
case 2: b+=k[1];
/* fall through */
case 1: a+=k[0];
/* case 0: nothing left to add */
}
Expand Down

0 comments on commit 6c9f69c

Please sign in to comment.