[PATCH 2/3] Inline release_id in voicecall.c

Zhang, Zhenhua zhenhua.zhang at intel.com
Wed Oct 28 02:53:23 PDT 2009


Hi Marcel,

Marcel Holtmann wrote:
> Hi Zhenhua,
>>
>> +unsigned int at_util_alloc_next_id(unsigned int *id_list) +{
>> +       unsigned int i;
>> +
>> +       for (i = 1; i < sizeof(unsigned int) * 8; i++) {
>> +               if (*id_list & (0x1 << i))
>> +                       continue;
>> +
>> +               *id_list |= (0x1 << i);
>> +               return i;
>> +       }
>> +
>> +       return 0;
>> +}
>> +
>> +inline void at_util_release_id(unsigned int *id_list, unsigned int
>> id) +{
>> +       *id_list &= ~(0x1 << id);
>> +}
> 
> what is this? Don't use inline at all and let the compiler decide. I
> also don't really understand how you think this works. There is
> nothing to inline here.
> 
> And while at it. Drop the 0x1 stuff. Using 1 is much more readable.

Ok. I update the patch to remove inline and replace 0x1 by 1. The
update version is attached.

> Regards
> 
> Marcel
> 
> 
> _______________________________________________
> ofono mailing list
> ofono at ofono.org
> http://lists.ofono.org/listinfo/ofono



Regards,
Zhenhua
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Move-and-rename-alloc_next_id-and-release_id-into-at.patch
Type: application/octet-stream
Size: 2995 bytes
Desc: 0002-Move-and-rename-alloc_next_id-and-release_id-into-at.patch
URL: <http://lists.ofono.org/pipermail/ofono/attachments/20091028/0d6cd448/attachment.obj>


More information about the ofono mailing list