Skip to contentSkip to conversation

airo.c: Description and function is not the same

RFC Richard Knutsson 2 participants 2 messages Jan 21, 2007 – Jan 23, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello

In the tour of converting local definitions of boolean-type/values, I ran into airo.c's description of ex decapsulate():

* Returns: BOOLEAN - TRUE if packet should be dropped otherwise FALSE

but returns SUCCESS (defined as 0) and ERROR (defined as -1).

Also, shouldn't those functions be converted to return 'bool' when the description say so (happy to do it).

Richard Knutsson

#1 lore raw
Quoted 11 lines · Richard Knutsson

Hello

In the tour of converting local definitions of boolean-type/values, I ran into airo.c's description of ex decapsulate():

* Returns: BOOLEAN - TRUE if packet should be dropped otherwise FALSE

but returns SUCCESS (defined as 0) and ERROR (defined as -1).

Also, shouldn't those functions be converted to return 'bool' when the description say so (happy to do it).

Does anyone use the Cisco MIC code anymore? I guess we can't just rip it out... It was a proprietary Cisco extension back before WPA.

In any case, the comment should be changed to reflect the current return values of the function, and SUCCESS and ERROR in decapsulate() should be changed to 0 and -1 respectively; defining stuff like success/error just makes things ugly, and 0 and -1 are well-enough-known that there should be no question what they mean.

Essentially, the code is using 0 and -1 as booleans anyway. I say get rid of SUCCESS & ERROR and just use 0 and -1, then change the comment.

dan

Quoted 6 lines

Richard Knutsson

-
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html