kernel/res_counter.c: move BUG() to the default choice of switch at res_counter_member()
PATCH 1/1 kernel/res_counter.c: move BUG() to the default choice of switch at res_counter_member()
It's quite obvious that the return statement after BUG() is invalid, we had better move BUG() to the default choice of the switch.
Signed-off-by Jie Liu <[email protected]>
--- kernel/res_counter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/res_counter.c +2 -3
@@ -135,10 +135,9 @@ res_counter_member(struct res_counter *counter, int member)return &counter->failcnt;case RES_SOFT_LIMIT :return &counter->soft_limit; +default : +BUG (); }; - -BUG (); -return NULL ; } ssize_t res_counter_read(struct res_counter *counter, int member,
Signature · 7 lines
1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Jeff Liu
kernel/res_counter.c +0
-0@@ -135,10 +135,9 @@ res_counter_member(struct res_counter *counter, int member)return &counter->failcnt;case RES_SOFT_LIMIT :
kernel/res_counter.c res_counter_member(struct res_counter *counter, int member) · line 143
Quoted 10 lines
kernel/res_counter.c +2
-3return &counter->soft_limit; +default : +BUG (); }; - -BUG (); -return NULL ; } ssize_t res_counter_read(struct res_counter *counter, int member,
This doesn't work for CONFIG_BUG=n, you still need a return value. I think the original version was better.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>