From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH_v2 1/7] profiles/network: Remove redundant code for bnep interface name
Date: Thu, 28 Nov 2013 21:55:33 +0200 [thread overview]
Message-ID: <52979FB5.6060401@linux.intel.com> (raw)
In-Reply-To: <CAJdJm_Marb2+Q4e=zLeHq9Qf4a=o4z3-Q55mpL0bDWq3h1-s_Q@mail.gmail.com>
Hi,
On 28.11.2013 17:52, Anderson Lizardo wrote:
> Hi Ravi,
>
> On Thu, Nov 28, 2013 at 10:45 AM, Ravi kumar Veeramally
> <ravikumar.veeramally@linux.intel.com> wrote:
>> Remove redundant code for copying bnepX interface name from connection
>> and server files. It is better to place on actual function call.
>> ---
>> profiles/network/common.c | 3 +--
>> profiles/network/connection.c | 2 --
>> profiles/network/server.c | 3 ---
>> 3 files changed, 1 insertion(+), 7 deletions(-)
>>
>> diff --git a/profiles/network/common.c b/profiles/network/common.c
>> index 0b291bd..b94b3a5 100644
>> --- a/profiles/network/common.c
>> +++ b/profiles/network/common.c
>> @@ -150,8 +150,7 @@ int bnep_connadd(int sk, uint16_t role, char *dev)
>> struct bnep_connadd_req req;
>>
>> memset(&req, 0, sizeof(req));
>> - strncpy(req.device, dev, 16);
>> - req.device[15] = '\0';
>> + strcpy(req.device, "bnep%d");
>> req.sock = sk;
>> req.role = role;
>> if (ioctl(ctl, BNEPCONNADD, &req) < 0) {
>> diff --git a/profiles/network/connection.c b/profiles/network/connection.c
>> index 5966268..301f66d 100644
>> --- a/profiles/network/connection.c
>> +++ b/profiles/network/connection.c
>> @@ -692,8 +692,6 @@ int connection_register(struct btd_service *service)
>>
>> nc = g_new0(struct network_conn, 1);
>> nc->id = id;
>> - memset(nc->dev, 0, sizeof(nc->dev));
>> - strcpy(nc->dev, "bnep%d");
>> nc->service = btd_service_ref(service);
>> nc->state = DISCONNECTED;
>> nc->peer = peer;
>> diff --git a/profiles/network/server.c b/profiles/network/server.c
>> index 0050b30..3a7e52a 100644
>> --- a/profiles/network/server.c
>> +++ b/profiles/network/server.c
>> @@ -269,9 +269,6 @@ static int server_connadd(struct network_server *ns,
>> char devname[16];
>> int err, nsk;
>>
>> - memset(devname, 0, sizeof(devname));
>> - strcpy(devname, "bnep%d");
>> -
>> nsk = g_io_channel_unix_get_fd(session->io);
>> err = bnep_connadd(nsk, dst_role, devname);
> You are still passing a (now uninitialized) devname pointer to
> bnep_connadd(). Is this still necessary?
You are right, it is missing in server.c but in connection.c struct is
created with g_new0.
Thanks,
Ravi.
next prev parent reply other threads:[~2013-11-28 19:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-28 14:45 [PATCH_v2 0/7] Refactor bnep code and implement pan methods Ravi kumar Veeramally
2013-11-28 14:45 ` [PATCH_v2 1/7] profiles/network: Remove redundant code for bnep interface name Ravi kumar Veeramally
2013-11-28 15:52 ` Anderson Lizardo
2013-11-28 16:12 ` Luiz Augusto von Dentz
2013-11-28 19:55 ` Ravi kumar Veeramally [this message]
2013-11-28 14:45 ` [PATCH_v2 2/7] profiles/network: Refactor bnep connection setup functionality Ravi kumar Veeramally
2013-11-28 14:45 ` [PATCH_v2 3/7] profiles/network: Rename common.c|h to bnep.c|h Ravi kumar Veeramally
2013-11-28 16:19 ` Luiz Augusto von Dentz
2013-11-28 19:52 ` Ravi kumar Veeramally
2013-11-28 14:45 ` [PATCH_v2 4/7] android/pan: Implement pan connect method in daemon Ravi kumar Veeramally
2013-11-28 14:45 ` [PATCH_v2 5/7] android/pan: Implement pan disconnect " Ravi kumar Veeramally
2013-11-28 14:45 ` [PATCH_v2 6/7] android/pan: Implement the get local role " Ravi kumar Veeramally
2013-11-28 14:45 ` [PATCH_v2 7/7] android: Add reasons for adding capabilites to process Ravi kumar Veeramally
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=52979FB5.6060401@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.com \
--cc=anderson.lizardo@openbossa.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.