public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <amwang@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Patch] ipc: remove unreachable code in sem.c
Date: Thu, 03 Dec 2009 16:27:00 +0800	[thread overview]
Message-ID: <4B177654.2090504@redhat.com> (raw)
In-Reply-To: <20091202144552.ea635692.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Tue, 1 Dec 2009 01:57:09 -0500
> Amerigo Wang <amwang@redhat.com> wrote:
> 
>> This line is unreachable, remove it.
>>
>> Signed-off-by: WANG Cong <amwang@redhat.com>
>>
>> ---
>> diff --git a/ipc/sem.c b/ipc/sem.c
>> index 87c2b64..8439f2f 100644
>> --- a/ipc/sem.c
>> +++ b/ipc/sem.c
>> @@ -652,7 +652,6 @@ static int semctl_nolock(struct ipc_namespace *ns, int semid,
>>  	default:
>>  		return -EINVAL;
>>  	}
>> -	return err;
>>  out_unlock:
>>  	sem_unlock(sma);
>>  	return err;
> 
> If we're going to do that then there's no point in initialising `err':
> 
> --- a/ipc/sem.c~ipc-remove-unreachable-code-in-semc-fix
> +++ a/ipc/sem.c
> @@ -624,7 +624,7 @@ static unsigned long copy_semid_to_user(
>  static int semctl_nolock(struct ipc_namespace *ns, int semid,
>  			 int cmd, int version, union semun arg)
>  {
> -	int err = -EINVAL;
> +	int err;
>  	struct sem_array *sma;
>  
>  	switch(cmd) {
> _
> 
> 
> you should have noticed this!

Oh, I didn't realize that. Thank you!


      reply	other threads:[~2009-12-03  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01  6:57 [Patch] ipc: remove unreachable code in sem.c Amerigo Wang
2009-12-02 22:45 ` Andrew Morton
2009-12-03  8:27   ` Cong Wang [this message]

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=4B177654.2090504@redhat.com \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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