All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: benh@kernel.crashing.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: the briq panel isn't a tty, make it use its own locking
Date: Thu, 23 Feb 2012 13:37:12 +0100	[thread overview]
Message-ID: <4F4632F8.8090006@suse.cz> (raw)
In-Reply-To: <20120223123314.1684.89844.stgit@bob.linux.org.uk>

On 02/23/2012 01:34 PM, Alan Cox wrote:
> --- a/drivers/char/briq_panel.c
> +++ b/drivers/char/briq_panel.c
...
> @@ -66,37 +67,28 @@ static void set_led(char state)
>  
>  static int briq_panel_open(struct inode *ino, struct file *filep)
>  {
> -	tty_lock();
> -	/* enforce single access, vfd_is_open is protected by BKL */
> -	if (vfd_is_open) {
> +	/* enforce single open */
> +	if (test_and_set_bit(0, &vfd_is_open)) {
>  		tty_unlock();

This one should be removed too.

>  		return -EBUSY;
>  	}
> -	vfd_is_open = 1;
> -
> -	tty_unlock();
>  	return 0;
>  }

thanks,
-- 
js
suse labs

  reply	other threads:[~2012-02-23 12:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 12:34 [PATCH] tty: the briq panel isn't a tty, make it use its own locking Alan Cox
2012-02-23 12:37 ` Jiri Slaby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-02-23 13:39 Alan Cox
2012-02-23 20:42 ` Benjamin Herrenschmidt
2012-02-23 22:56   ` Alan Cox
2012-02-24  1:08     ` Josh Boyer
2012-02-24  1:37     ` Benjamin Herrenschmidt
2012-02-29 20:21       ` Greg KH

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=4F4632F8.8090006@suse.cz \
    --to=jslaby@suse.cz \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.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 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.