Re: [PATCH 3/3] x_tables: Factor out 16bit aligment ifname_compare()
From: Jan Engelhardt
Date: Sun Jan 11 2015 - 17:23:10 EST
On Sunday 2015-01-11 22:30, Richard Weinberger wrote:
>>>> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/