Skip to content

Commit

Permalink
staging: lustre: ptlrpc: avoid warning on missing return
Browse files Browse the repository at this point in the history
The newly added function triggers a harmless warning:

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c: In function 'lustre_shrink_msg':
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c:472:1: error: control reaches end of non-void function [-Werror=return-type]

This probably happens because LASSERTF() contains an 'unlikely()' that
sometimes prevents gcc from analysing the control flow correctly.
Adding a return statement here seems harmless and lets us keep that
unlikely().

Fixes: 96049bd ("staging: lustre: ptlrpc: embed highest XID in each request")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Arnd Bergmann authored and Greg Kroah-Hartman committed Jan 27, 2017
1 parent f3147b6 commit 74e3bb7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ int lustre_shrink_msg(struct lustre_msg *msg, int segment,
default:
LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic);
}
return 0;
}
EXPORT_SYMBOL(lustre_shrink_msg);

Expand Down

0 comments on commit 74e3bb7

Please sign in to comment.