Open Source Telephony
 help / color / mirror / Atom feed
From: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
To: ofono@ofono.org
Subject: Re: [PATCHv3 03/12] call-forwarding: Refactor cf_condition_find_with_cls() slightly
Date: Wed, 21 Mar 2012 13:45:26 +0200	[thread overview]
Message-ID: <4F69BF56.6020101@intel.com> (raw)
In-Reply-To: <4F6917C2.2050001@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]

Hello Denis,

On 03/21/2012 01:50 AM, Denis Kenzior wrote:
>> +	return CFC(a)->cls - CFC(b)->cls;
>
> You're breaking const-correctness here.

Thanks for pointing this. The intention was to save a few instructions here, but 
just missed that.

> Also, why do you rename the function?  I do think we should have
> 'condition' or at least 'cond' in the name to make it clear what it
> does.  My vote is for cf_cond_compare...

Thanks, I agree, cf_cond_compare() would be more consistent and clear.

>> +static struct ofono_call_forwarding_condition *cf_find(GSList *l, int cls)
>
> Same as above, at least name it cf_cond_find.  Also, I'd prefer changes
> to this function to be in a separate patch.

OK.

>> -static int cf_find_timeout(GSList *cf_list, int cls)
>> +static int cf_find_timeout(GSList *l, int cls)
>
> Same here, lets name this cf_cond_find_timeout

OK.

>> -static void cf_cond_list_print(GSList *list)
>> +static void cf_cond_list_print(GSList *l)
>>   {
>> -	GSList *l;
>> -	struct ofono_call_forwarding_condition *cond;
>> -
>> -	for (l = list; l; l = l->next) {
>> -		cond = l->data;
>> +	struct ofono_call_forwarding_condition *c;
>>
>> +	for (; l&&  (c = l->data); l = l->next)
>
> After going back and forth on this one, I'm actually against this style.
>   Mainly it is too hard to notice the assignment, inside the continuation
> check expression.  I'd really prefer that we assign c inside the for
> loop block.  Also, l->data should never be NULL, so in this case I'd
> rather crash and find out early than inadvertently covering it up.

OK, thanks. I agree on both points here.

>> +			number = new_cfu ? "" : phone_number_to_string(
>>   							&lc->phone_number);
>
> This part really belongs in a separate patch.

OK.

Thanks for the help, I will correct all these.

Regards,
Oleg
-- 
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki


  reply	other threads:[~2012-03-21 11:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 13:46 [PATCHv3 00/12] Call forwarding state handling change Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 01/12] call-forwarding: Remove cf_list_clear() Oleg Zhurakivskyy
2012-03-19 19:03   ` Denis Kenzior
2012-03-13 13:46 ` [PATCHv3 02/12] call-forwarding: Inline get_query_next_cf_cond() Oleg Zhurakivskyy
2012-03-19 19:03   ` Denis Kenzior
2012-03-13 13:46 ` [PATCHv3 03/12] call-forwarding: Refactor cf_condition_find_with_cls() slightly Oleg Zhurakivskyy
2012-03-20 23:50   ` Denis Kenzior
2012-03-21 11:45     ` Oleg Zhurakivskyy [this message]
2012-03-13 13:46 ` [PATCHv3 04/12] call-forwarding: Refactor cf_find_unconditional() Oleg Zhurakivskyy
2012-03-20 23:51   ` Denis Kenzior
2012-03-21 11:46     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 05/12] call-forwarding: Minor cleanup of set_query_cf_callback Oleg Zhurakivskyy
2012-03-20 23:54   ` Denis Kenzior
2012-03-21 11:47     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 06/12] call-forwarding: Don't run conditional queries if cfu is active Oleg Zhurakivskyy
2012-03-21  0:09   ` Denis Kenzior
2012-03-21 11:49     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 07/12] call-forwarding: Re-run conditional queries on cfu removal Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 08/12] call-forwarding: Toggle the cached flag on CFU changes Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 09/12] call-forwarding: Cache cfs on CFU removal Oleg Zhurakivskyy
2012-03-21  0:16   ` Denis Kenzior
2012-03-21 11:51     ` Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 10/12] call-forwarding: Re-run ss path cfs queries on cfu changes Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 11/12] call-forwarding: Cache cfs on all/all conditional removal Oleg Zhurakivskyy
2012-03-13 13:46 ` [PATCHv3 12/12] TODO: Remove completed call forwarding state task Oleg Zhurakivskyy

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=4F69BF56.6020101@intel.com \
    --to=oleg.zhurakivskyy@intel.com \
    --cc=ofono@ofono.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