From: Johan Hedberg <johan.hedberg@gmail.com>
To: Szymon Janc <szymon.janc@tieto.com>
Cc: linux-bluetooth@vger.kernel.org,
par-gunnar.p.hjalmdahl@stericsson.com,
henrik.possung@stericsson.com
Subject: Re: [PATCH v6 4/6] Add D-Bus OOB plugin
Date: Fri, 25 Mar 2011 10:54:36 +0200 [thread overview]
Message-ID: <20110325085436.GD30796@jh-x301> (raw)
In-Reply-To: <1300974459-24076-5-git-send-email-szymon.janc@tieto.com>
Hi Szymon,
On Thu, Mar 24, 2011, Szymon Janc wrote:
> +static GDBusMethodTable oob_methods[] = {
> + {"AddRemoteOobData", "sayay", "", add_remote_data},
> + {"RemoveRemoteOobData", "s", "", remove_remote_data},
> + {"ReadLocalOobData", "", "ayay", read_local_data,
> + G_DBUS_METHOD_FLAG_ASYNC},
> + { }
> +};
You're using mixing spaces and tabs for indentation within this table.
Just use table if you want to align the columns.
> +static void oob_remove(struct btd_adapter *adapter)
> +{
> + local_data_read(adapter, NULL, NULL);
> +
> + g_dbus_unregister_interface(connection, adapter_get_path(adapter),
> + OOB_INTERFACE);
> +}
> +
> +
> +static struct btd_adapter_driver oob_driver = {
There should never be the need to have two consecutive empty lines.
Please remove one.
> + while ((match = g_slist_next(oob_requests))) {
> + oob_request = match->data;
> + oob_remove(oob_request->adapter);
> + }
This loop looks flawed to me. Why are you skipping the first element in
the list? It also took some time to see that you don't have an infinite
loop here as it's a quite indirect way that the elements get removed.
Furthermore, you've got functions called "local_data_read" and
"read_local_data". Do you think someone would immediately understand the
difference from those names? Maybe local_data_read could be named
read_local_data_complete or read_local_data_cb or something similar?
Johan
next prev parent reply other threads:[~2011-03-25 8:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 13:47 [PATCH v6 0/6] Support for out of band association model Szymon Janc
2011-03-24 13:47 ` [PATCH v6 1/6] Add initial support for Out of Band (OOB) " Szymon Janc
2011-03-25 8:28 ` Johan Hedberg
2011-03-24 13:47 ` [PATCH v6 2/6] Add support for Out of Band (OOB) association model in mgmtops Szymon Janc
2011-03-25 8:30 ` Johan Hedberg
2011-03-24 13:47 ` [PATCH v6 3/6] Add support for Out of Band (OOB) association model in hciops Szymon Janc
2011-03-25 8:33 ` Johan Hedberg
2011-03-26 11:26 ` Szymon Janc
2011-03-24 13:47 ` [PATCH v6 4/6] Add D-Bus OOB plugin Szymon Janc
2011-03-25 8:54 ` Johan Hedberg [this message]
2011-03-24 13:47 ` [PATCH v6 5/6] Update mgmt-api.txt with OOB commands Szymon Janc
2011-03-24 13:47 ` [PATCH v6 6/6] Add oob-api.txt with documentation about OOB D-Bus methods Szymon Janc
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=20110325085436.GD30796@jh-x301 \
--to=johan.hedberg@gmail.com \
--cc=henrik.possung@stericsson.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=par-gunnar.p.hjalmdahl@stericsson.com \
--cc=szymon.janc@tieto.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