Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@nokia.com>
To: Radoslaw Jablonski <ext-jablonski.radoslaw@nokia.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/3] Add return value to reply_list_foreach_t in phonebook-tracker
Date: Wed, 9 Feb 2011 13:56:50 -0800	[thread overview]
Message-ID: <20110209215650.GA11911@jh-x301> (raw)
In-Reply-To: <1297081658-30573-1-git-send-email-ext-jablonski.radoslaw@nokia.com>

Hi Radek,

On Mon, Feb 07, 2011, Radoslaw Jablonski wrote:
> +	return -1;

Could you please use some more meaningful POSIX error codes here,
-EINVAL, etc.

> @@ -1645,13 +1652,14 @@ fail:
>  	g_free(temp_id);
>  	temp_id = NULL;
>  
> +	return -1;

Same here.

>  done:
>  	if (num_fields <= 0)
>  		data->ready_cb(data->user_data);
>  
> +	return -1;

And here.

>  	if (num_fields < 0) {
>  		data->cb(NULL, 0, num_fields, 0, data->user_data);
> -		return;
> +		return -1;

And here.

>  	}
>  
>  	if (data->params->maxlistcount == 0) {
> @@ -1880,6 +1889,8 @@ done:
>  	query_tracker(query, col_amount, pull_cb, data, &err);
>  	if (err < 0)
>  		data->cb(NULL, 0, err, 0, data->user_data);
> +
> +	return -1;
>  }

This looks a bit strange. Is it really a failure even if err is 0? I'd
expect the return statement to look like "return err;". Btw, why doesn't
query_tracker return the error in its return value?

Johan

      parent reply	other threads:[~2011-02-09 21:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 12:27 [PATCH 1/3] Add return value to reply_list_foreach_t in phonebook-tracker Radoslaw Jablonski
2011-02-07 12:27 ` [PATCH 2/3] Remove unnecessary checking for num_fields in pull_contact Radoslaw Jablonski
2011-02-07 12:27 ` [PATCH 3/3] Support for stop fetching data when maxlistcount is achieved Radoslaw Jablonski
2011-02-09 21:56 ` Johan Hedberg [this message]

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=20110209215650.GA11911@jh-x301 \
    --to=johan.hedberg@nokia.com \
    --cc=ext-jablonski.radoslaw@nokia.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