Thread (23 messages) flat view 23 messages, 6 authors, 2015-01-12

Re: [PATCH 3/3] x_tables: Factor out 16bit aligment ifname_compare()

From: Jan Engelhardt <hidden>
Date: 2015-01-11 22:23:07
Also in: lkml, netfilter-devel

On Sunday 2015-01-11 22:30, Richard Weinberger wrote:
quoted
quoted
quoted
Perhaps this would be better as bool ifname_compare
Anyway, I agree with Linus wrt. bool.
https://lkml.org/lkml/2013/8/31/138
Had the function return "bool", it would have been obvious enough
what to do with its return type. A return type of "int" might have
hinted towards negative-is-error (in general) or strcmpish values
(functions doing string compare work).

Now that it returns "unsigned long", one is pressed to look at the 
function body (not bad per se, but it is a hump) for the return 
value's semantics.

Linus says bool is dangerous to the unsuspecting user — but so is
"volatile", microwave ovens, etc. If the kernel really cared for
entry-level coders, it would be written in something like MISRA C.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help