* [RFC] airo.c: Description and function is not the same
@ 2007-01-21 12:01 Richard Knutsson
2007-01-23 15:11 ` Dan Williams
0 siblings, 1 reply; 2+ messages in thread
From: Richard Knutsson @ 2007-01-21 12:01 UTC (permalink / raw)
To: linville; +Cc: netdev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC] airo.c: Description and function is not the same
2007-01-21 12:01 [RFC] airo.c: Description and function is not the same Richard Knutsson
@ 2007-01-23 15:11 ` Dan Williams
0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2007-01-23 15:11 UTC (permalink / raw)
To: Richard Knutsson; +Cc: linville, netdev
On Sun, 2007-01-21 at 13:01 +0100, Richard Knutsson wrote:
> 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
> Richard Knutsson
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-01-23 15:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-21 12:01 [RFC] airo.c: Description and function is not the same Richard Knutsson
2007-01-23 15:11 ` Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).