public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	David Rientjes <rientjes@google.com>
Subject: Re: [RESEND] [PATCH] kernel/res_counter.c: remove useless return statement at res_counter_member()
Date: Thu, 14 Feb 2013 15:21:22 -0800	[thread overview]
Message-ID: <20130214152122.920f4936.akpm@linux-foundation.org> (raw)
In-Reply-To: <510C9E74.3070402@oracle.com>

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.


  reply	other threads:[~2013-02-14 23:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02  5:04 [RESEND] [PATCH] kernel/res_counter.c: remove useless return statement at res_counter_member() Jeff Liu
2013-02-14 23:21 ` Andrew Morton [this message]
2013-02-16 10:27   ` Jeff Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130214152122.920f4936.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jeff.liu@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox