public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, zohar@us.ibm.com,
	dvelarde@us.ibm.com, safford@us.ibm.com
Subject: Re: [PATCH][resubmit] TPM: update char dev BKL pushdown
Date: Tue, 26 Aug 2008 22:19:48 -0500	[thread overview]
Message-ID: <20080827031948.GA5184@us.ibm.com> (raw)
In-Reply-To: <20080826220823.509571fd@lxorguk.ukuu.org.uk>

Quoting Alan Cox (alan@lxorguk.ukuu.org.uk):
> > +	atomic_set(&chip->is_open, 1);
> > +	get_device(chip->dev); /* protect from chip disappearing */
> 
> Why not just use test_and_set_bit() ? You seem to be abusing atomic_t to
> achieve this.

Good point.  Or heck just make it a simple flag.  Earlier I thought there
was a place where driver_lock was taken just to do num_opens--, and so
replacing the int num_opens with an atomic_t seemed worthwhile.  But since
is_open is a boolean and now seems to be always protected by driver_lock,
a flag seems best.

-serge

  reply	other threads:[~2008-08-27  3:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26 20:56 [PATCH][resubmit] TPM: update char dev BKL pushdown Rajiv Andrade
2008-08-26 21:08 ` Alan Cox
2008-08-27  3:19   ` Serge E. Hallyn [this message]
2008-08-27 14:32     ` Rajiv Andrade
2008-08-26 21:29 ` Serge E. Hallyn

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=20080827031948.GA5184@us.ibm.com \
    --to=serue@us.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dvelarde@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=safford@us.ibm.com \
    --cc=srajiv@linux.vnet.ibm.com \
    --cc=zohar@us.ibm.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