All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, dbueso@suse.de
Subject: Re: [PATCH 2/2] locking/rwsem-spinlock: Cleanup down_read()
Date: Tue, 16 Sep 2014 09:48:22 +0200	[thread overview]
Message-ID: <20140916074821.GA21542@gmail.com> (raw)
In-Reply-To: <1410500066-5909-2-git-send-email-dave@stgolabs.net>


* Davidlohr Bueso <dave@stgolabs.net> wrote:

> ... when returning from a successful lock acquisition. The horror!
> 
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
>  kernel/locking/rwsem-spinlock.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/kernel/locking/rwsem-spinlock.c b/kernel/locking/rwsem-spinlock.c
> index 2c93571..07e456c 100644
> --- a/kernel/locking/rwsem-spinlock.c
> +++ b/kernel/locking/rwsem-spinlock.c
> @@ -130,7 +130,7 @@ void __sched __down_read(struct rw_semaphore *sem)
>  		/* granted */
>  		sem->count++;
>  		raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
> -		goto out;
> +		return;
>  	}
>  
>  	tsk = current;
> @@ -155,8 +155,6 @@ void __sched __down_read(struct rw_semaphore *sem)
>  	}
>  
>  	tsk->state = TASK_RUNNING;
> - out:
> -	;
>  }

It following an existing 'out' pattern found elsewhere in the 
file - I don't think there's much wrong about that per se - 
especially in locking code we try to not return from the middle 
of the flow.

Thanks,

	Ingo

  reply	other threads:[~2014-09-16  7:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12  5:34 [PATCH 1/2] locking/rwsem: EXPORT_SYMBOL follows function definition Davidlohr Bueso
2014-09-12  5:34 ` [PATCH 2/2] locking/rwsem-spinlock: Cleanup down_read() Davidlohr Bueso
2014-09-16  7:48   ` Ingo Molnar [this message]
2014-09-16 10:56 ` [tip:locking/core] locking/rwsem: Move EXPORT_SYMBOL() lines to follow function definition tip-bot for Davidlohr Bueso

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=20140916074821.GA21542@gmail.com \
    --to=mingo@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.