lkml.org 
[lkml]   [2013]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND] [PATCH] kernel/res_counter.c: remove useless return statement at res_counter_member()
On Sat, 02 Feb 2013 13:04:52 +0800
Jeff Liu <jeff.liu@oracle.com> wrote:

> The return statement after BUG() is invalid, move BUG() to the default choice of the switch.
>
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> ---
> kernel/res_counter.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/res_counter.c b/kernel/res_counter.c
> index ff55247..748a3bc 100644
> --- a/kernel/res_counter.c
> +++ b/kernel/res_counter.c
> @@ -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,

I expect it was done that way to avoid a hey-theres-no-return-statement
warning when CONFIG_BUG=n.



\
 
 \ /
  Last update: 2013-02-15 01:02    [W:0.043 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site