linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: "Gustavo F. Padovan" <padovan@profusion.mobi>,
	Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2 1/5] Bluetooth: clean up sco code
Date: Thu, 02 Dec 2010 08:49:19 +0100	[thread overview]
Message-ID: <1291276159.4795.99.camel@aeonflux> (raw)
In-Reply-To: <20101202071224.GA15525@jh-x301>

Hi Johan,

> > > -static int disable_esco = 0;
> > > +static int disable_esco;
> > 
> > I don't think this change is right. Can we be sure that disable_esco
> > will be 0 by default?
> 
> AFAIK we can since static variables are initialized to 0 by default.
> However, I've understood that it's good style to have this
> initialization explicit in the code so imho the code should be left as
> it is.

personally I prefer to initialize the variables to an initial value to
make it clear what their default is.

That said, this comes with a cost in case of a 0 or NULL initialization
since the compiler has to store extra code to do so. Not doing an
explicit initialization saves code size in this case.

The general kernel recommendation is to not initialize and I am fine
with following that one.

Regards

Marcel



  reply	other threads:[~2010-12-02  7:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 14:58 [PATCHv2 0/5] Clean up sco, rfcomm and hci code Emeltchenko Andrei
2010-12-01 14:58 ` [PATCHv2 1/5] Bluetooth: clean up sco code Emeltchenko Andrei
2010-12-01 21:20   ` Gustavo F. Padovan
2010-12-01 21:31     ` Anderson Lizardo
2010-12-01 21:44       ` Gustavo F. Padovan
2010-12-02  7:14       ` Johan Hedberg
2010-12-02  7:12     ` Johan Hedberg
2010-12-02  7:49       ` Marcel Holtmann [this message]
2010-12-01 14:58 ` [PATCHv2 2/5] Bluetooth: clean up rfcomm code Emeltchenko Andrei
2010-12-01 21:52   ` Gustavo F. Padovan
2010-12-01 14:58 ` [PATCHv2 3/5] Bluetooth: clean up l2cap code Emeltchenko Andrei
2010-12-01 21:21   ` Gustavo F. Padovan
2010-12-01 21:53   ` Gustavo F. Padovan
2010-12-01 14:58 ` [PATCHv2 4/5] Bluetooth: clean up hci code Emeltchenko Andrei
2010-12-01 21:53   ` Gustavo F. Padovan
2010-12-01 14:58 ` [PATCHv2 5/5] Bluetooth: clean up legal text Emeltchenko Andrei
2010-12-01 21:42   ` Gustavo F. 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=1291276159.4795.99.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=Andrei.Emeltchenko.news@gmail.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=padovan@profusion.mobi \
    /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;
as well as URLs for NNTP newsgroup(s).