All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Danis <frederic.danis@linux.intel.com>
To: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/4] sdp: Make sdp_record_add to be handled by adapter
Date: Wed, 28 Aug 2013 12:02:18 +0200	[thread overview]
Message-ID: <521DCAAA.8010203@linux.intel.com> (raw)
In-Reply-To: <1377522441-28671-4-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hello Grzegorz,

On 26/08/2013 15:07, Grzegorz Kolodziejczyk wrote:
<snip>
> diff --git a/src/adapter.c b/src/adapter.c
> index fd20d61..8e897ce 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -6307,6 +6307,37 @@ void adapter_start_sdp_server(uint16_t sdp_mtu, uint32_t sdp_flags) {
>   		adapter_foreach(adapter_service_insert, services->data);
>   }
>
> +int adapter_add_record_to_server(const bdaddr_t *device, sdp_record_t *rec)
> +{
> +	int chck;
> +	struct btd_adapter *adapter;
> +
> +	chck = add_record_to_server(device, rec);
> +
> +	//  Check if rec handle error occure
> +	//
> +	//  0       - Ok
> +	//
> +	//  handle == 0xffffffff
> +	//  -ENOSPC - next handle < 0x10000
> +	//
> +	//  -EEXIST - record already exist

Please use C89 coding style for comments, like defined for the Linux 
kernel. I.e.:
	/*
	 * comment
	 * comment
	 */

> +	if (chck == 0) {
> +		//  Add rec for each adapter

idem here ( /* comment */ )

> +		if (bacmp(device, BDADDR_ANY) == 0) {
> +			adapter_foreach(adapter_service_insert, rec);
> +			return chck;
> +		}
> +
> +		//  Add rec for single adapter

and here

> +		adapter = adapter_find(device);
> +		if (adapter)
> +			adapter_service_insert(adapter, rec);
> +	}
> +
> +	return chck;
> +}
> +

Regards

Fred

-- 
Frederic Danis                            Open Source Technology Center
frederic.danis@intel.com                              Intel Corporation


  reply	other threads:[~2013-08-28 10:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 13:07 [PATCH 0/4] *** Make sdp independent from adapter *** Grzegorz Kolodziejczyk
2013-08-26 13:07 ` [PATCH 1/4] sdp: Move sdp server init to adapter Grzegorz Kolodziejczyk
2013-08-28 10:01   ` Frederic Danis
2013-08-26 13:07 ` [PATCH 2/4] sdp: Move spd_init_services_list " Grzegorz Kolodziejczyk
2013-08-26 13:07 ` [PATCH 3/4] sdp: Make sdp_record_add to be handled by adapter Grzegorz Kolodziejczyk
2013-08-28 10:02   ` Frederic Danis [this message]
2013-08-26 13:07 ` [PATCH 4/4] sdp: Make sdp_record_remove " Grzegorz Kolodziejczyk
2013-08-28 10:04   ` Frederic Danis
  -- strict thread matches above, loose matches on Subject: below --
2013-08-29  9:56 [PATCH 0/4] Make sdp independent from adapter Grzegorz Kolodziejczyk
2013-08-29  9:56 ` [PATCH 3/4] sdp: Make sdp_record_add to be handled by adapter Grzegorz Kolodziejczyk

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=521DCAAA.8010203@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=grzegorz.kolodziejczyk@tieto.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 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.