[PATCH] dbus: Change WPA/RSNIE byte array props to dicts

Witold Sowa witold.sowa
Fri Jan 15 08:16:02 PST 2010


Jon Loeliger pisze:
> On Fri, 2010-01-15 at 14:32 +0100, Witold Sowa wrote:
> 
>>>> +	if ((old->ie_len == new->ie_len) ||
>>>> +	     os_memcmp(old + 1, new + 1, old->ie_len) == 0)
>>>> +		return changes;
>>>> +	else
>>>> +		changes |= WPA_BSS_IES_CHANGED_FLAG;
>>>> +
>> At first, I've noticed a bug in the condition, the should be AND instead
>> of OR. Jouni, please correct this before applying.
>>
>>> Why do you bother an else branch here? It just make the code harder to
>>> read.
>>>
>> The else branch is for case that IEs has changed. There is an
>> appropriate flag set and after the else statement the WPA/RSN/WPS IEs
>> are checked for changes.
> 
> The issue is not whether the line "changes |= ..." is needed or not.
> 
> The issue is that the "else" is not needed as the previous "return"
> limits the control flow to _only_ the "else" code following.  So
> just remove the "else" and out-dent the "changes |= ..." line.
> 
Ohh, yeah. I see now what was your point. Sure, the else statement is
not needed there.

Witek.



More information about the Hostap mailing list