From: Johan Hedberg <johan.hedberg@gmail.com>
To: chen.ganir@ti.com
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v3 5/5] DeviceInfo: Read PNP ID
Date: Thu, 29 Mar 2012 13:22:32 +0300 [thread overview]
Message-ID: <20120329102232.GD23176@x220> (raw)
In-Reply-To: <1332948405-1104-6-git-send-email-chen.ganir@ti.com>
Hi Chen,
On Wed, Mar 28, 2012, chen.ganir@ti.com wrote:
> + if (status != 0) {
> + DBG("value read failed: %s",
> + att_ecode2str(status));
Why is this split into two lines. The call can easily fit within 80
chars with all of its parameters. Also, this should be error() and not
DBG().
> + if (!dec_read_resp(pdu, len, value, &vlen)) {
> + DBG("Protocol error\n");
This should be error() and the \n at the end should be removed.
> + device_set_pnpid(ch->d->dev,value[0],att_get_u16(&value[1]), att_get_u16(&value[3]),
> + att_get_u16(&value[5]));
Over 80 character line and the continuation looks like it's incorrectly
indented (it should be indented with tabs as much as possible as long as
you don't hit the 80 character boundary.
> +static void process_deviceinfo_char(struct characteristic *ch)
> +{
> + if (g_strcmp0(ch->attr.uuid, PNPID_UUID) == 0) {
> + gatt_read_char(ch->d->attrib, ch->attr.value_handle, 0,
> + read_pnpid_cb, ch);
> + return;
> + }
> +}
The explicit return statement seems redundant since that's what the
function does anyway even without the if-branch. You can then also
remove the {}.
Johan
next prev parent reply other threads:[~2012-03-29 10:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 15:26 [PATCH v3 0/5] Add DeviceInformationService plugin chen.ganir
2012-03-28 15:26 ` [PATCH v3 1/5] Add DeviceInformation GATT Client chen.ganir
2012-03-29 10:15 ` Johan Hedberg
2012-03-28 15:26 ` [PATCH v3 2/5] DeviceInfo: Add connection logic chen.ganir
2012-03-28 15:26 ` [PATCH v3 3/5] DeviceInfo: Discover Characteristics chen.ganir
2012-03-29 10:18 ` Johan Hedberg
2012-03-28 15:26 ` [PATCH v3 4/5] Fix device version in GetProperties chen.ganir
2012-03-29 10:19 ` Johan Hedberg
2012-03-28 15:26 ` [PATCH v3 5/5] DeviceInfo: Read PNP ID chen.ganir
2012-03-29 10:22 ` Johan Hedberg [this message]
2012-03-29 10:45 ` Anderson Lizardo
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=20120329102232.GD23176@x220 \
--to=johan.hedberg@gmail.com \
--cc=chen.ganir@ti.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).