linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2 1/3] Bluetooth: Move scope of state_to_string
Date: Fri, 17 Feb 2012 10:49:40 +0100	[thread overview]
Message-ID: <1329472180.28848.167.camel@aeonflux> (raw)
In-Reply-To: <1329471657-18278-2-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> Function state_to_string will be used in other files in debug
> statements.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  include/net/bluetooth/bluetooth.h |   27 +++++++++++++++++++++++++++
>  net/bluetooth/l2cap_core.c        |   26 --------------------------
>  2 files changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
> index 4a82ca0..0a47c20 100644
> --- a/include/net/bluetooth/bluetooth.h
> +++ b/include/net/bluetooth/bluetooth.h
> @@ -129,6 +129,33 @@ enum {
>  	BT_CLOSED
>  };
>  
> +/* If unused will be removed by compiler */
> +static inline char *state_to_string(int state)
> +{

actually const char * please.

> +	switch (state) {
> +	case BT_CONNECTED:
> +		return "BT_CONNECTED";
> +	case BT_OPEN:
> +		return "BT_OPEN";
> +	case BT_BOUND:
> +		return "BT_BOUND";
> +	case BT_LISTEN:
> +		return "BT_LISTEN";
> +	case BT_CONNECT:
> +		return "BT_CONNECT";
> +	case BT_CONNECT2:
> +		return "BT_CONNECT2";
> +	case BT_CONFIG:
> +		return "BT_CONFIG";
> +	case BT_DISCONN:
> +		return "BT_DISCONN";
> +	case BT_CLOSED:
> +		return "BT_CLOSED";
> +	}
> +
> +	return "invalid state";
> +}
> +

Otherwise it is fine.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



  reply	other threads:[~2012-02-17  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17  9:40 [PATCHv2 0/3] Ease debugging patches Emeltchenko Andrei
2012-02-17  9:40 ` [PATCHv2 1/3] Bluetooth: Move scope of state_to_string Emeltchenko Andrei
2012-02-17  9:49   ` Marcel Holtmann [this message]
2012-02-17  9:40 ` [PATCHv2 2/3] Bluetooth: Use symbolic names for state in debug Emeltchenko Andrei
2012-02-17  9:50   ` Marcel Holtmann
2012-02-17  9:40 ` [PATCHv2 3/3] Bluetooth: Prefix hex numbers with object name Emeltchenko Andrei
2012-02-17  9:48   ` Marcel Holtmann
2012-02-17 11:03 ` [PATCHv2 0/3] Ease debugging patches Johan Hedberg

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=1329472180.28848.167.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=Andrei.Emeltchenko.news@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).