[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79eee958-818e-9fb4-6b61-4b510d040a64@gmail.com>
Date: Mon, 22 Nov 2021 16:17:33 +0000
From: Edward Cree <ecree.xilinx@...il.com>
To: Alejandro Colomar <alx.manpages@...il.com>, netdev@...r.kernel.org
Cc: Martin Habets <habetsm.xilinx@...il.com>
Subject: Re: [PATCH] drivers/net/ethernet/sfc/: Simplify code
On 20/11/2021 20:14, Alejandro Colomar wrote:
> That ternary operator has
> the same exact code in both of the branches.
>
> Unless there's some hidden magic in the condition,
> there's no reason for it to be,
> and it can be replaced
> by the code in one of the branches.
>
> That code has been untouched since it was added,
> so there's no information in git about
> why it was written that way.
>
> Signed-off-by: Alejandro Colomar <alx.manpages@...il.com>
> Cc: Edward Cree <ecree.xilinx@...il.com>
> Cc: Martin Habets <habetsm.xilinx@...il.com>
> Cc: netdev@...r.kernel.org
I guess it's there for type-checking — essentially as an assert that
field_type == typeof(efx_##source_name.field). Probably when it was
added there was no standard way to do this; now we could probably
use <linux/typecheck.h> or some such.
The comment just above the macro does mention "with type-checking".
-ed
Powered by blists - more mailing lists