public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: Gustavo Padovan <gustavo@padovan.org>, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/7] Bluetooth: debug: Print l2cap refcount
Date: Wed, 11 Jul 2012 14:37:58 +0300	[thread overview]
Message-ID: <20120711113756.GB3044@aemeltch-MOBL1> (raw)
In-Reply-To: <20120710183333.GC13847@joana>

Hi Gustavo,

On Tue, Jul 10, 2012 at 03:33:33PM -0300, Gustavo Padovan wrote:
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > ---
> >  include/net/bluetooth/l2cap.h |    6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> > index d80e3f0..dfe9374 100644
> > --- a/include/net/bluetooth/l2cap.h
> > +++ b/include/net/bluetooth/l2cap.h
> > @@ -672,11 +672,17 @@ enum {
> >  
> >  static inline void l2cap_chan_hold(struct l2cap_chan *c)
> >  {
> > +	BT_DBG("chan %p refcnt %d -> %d", c, atomic_read(&c->refcnt),
> > +	       atomic_read(&c->refcnt) + 1);
> > +
> 
> We don't really need to call atomic_read() twice read. Just print the new
> value and the log reader has to figure it out.

The code looks better if I print original refcnt in a case chan_put and
also for kref cases with amp_mgr. I will send patches shortly.

Best regards 
Andrei Emeltchenko 

  reply	other threads:[~2012-07-11 11:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10 12:27 [PATCH 0/7] Bluetooth: Correct debug code Andrei Emeltchenko
2012-07-10 12:27 ` [PATCH 1/7] Bluetooth: debug: Print l2cap refcount Andrei Emeltchenko
2012-07-10 18:33   ` Gustavo Padovan
2012-07-11 11:37     ` Andrei Emeltchenko [this message]
2012-07-11 11:43     ` [PATCH 1/2] Bluetooth: debug: Print l2cap_chan refcount Andrei Emeltchenko
2012-07-11 11:43       ` [PATCH 2/2] Bluetooth: debug: Print amp_mgr refcnt Andrei Emeltchenko
2012-07-11 13:10         ` Gustavo Padovan
2012-07-10 12:27 ` [PATCH 2/7] " Andrei Emeltchenko
2012-07-10 12:27 ` [PATCH 3/7] Bluetooth: debug: Add printing num of cmds queued Andrei Emeltchenko
2012-07-10 12:27 ` [PATCH 4/7] Bluetooth: debug: Use standard hex object specifier Andrei Emeltchenko
2012-07-10 18:38   ` Gustavo Padovan
2012-07-11 11:32     ` [PATCH] Bluetooth: debug: Use standard hex object specifiers in hci_event Andrei Emeltchenko
2012-07-11 13:07       ` Gustavo Padovan
2012-07-10 12:27 ` [PATCH 5/7] Bluetooth: debug: Correct types specifiers for L2CAP Andrei Emeltchenko
2012-07-10 12:27 ` [PATCH 6/7] Bluetooth: debug: Print CID and PSM in hex format Andrei Emeltchenko
2012-07-10 12:27 ` [PATCH 7/7] Bluetooth: debug: Add debug to l2cap_security_cfm Andrei Emeltchenko
2012-07-10 18:44   ` Gustavo Padovan

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=20120711113756.GB3044@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=gustavo@padovan.org \
    --cc=linux-bluetooth@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