[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190619.172955.2027826462085142095.davem@davemloft.net>
Date: Wed, 19 Jun 2019 17:29:55 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: mka@...omium.org
Cc: kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org,
alexander.h.duyck@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, dianders@...omium.org
Subject: Re: [PATCH] net/ipv4: fib_trie: Avoid cryptic ternary expressions
From: Matthias Kaehlcke <mka@...omium.org>
Date: Tue, 18 Jun 2019 14:14:40 -0700
> empty_child_inc/dec() use the ternary operator for conditional
> operations. The conditions involve the post/pre in/decrement
> operator and the operation is only performed when the condition
> is *not* true. This is hard to parse for humans, use a regular
> 'if' construct instead and perform the in/decrement separately.
>
> This also fixes two warnings that are emitted about the value
> of the ternary expression being unused, when building the kernel
> with clang + "kbuild: Remove unnecessary -Wno-unused-value"
> (https://lore.kernel.org/patchwork/patch/1089869/):
>
> CC net/ipv4/fib_trie.o
> net/ipv4/fib_trie.c:351:2: error: expression result unused [-Werror,-Wunused-value]
> ++tn_info(n)->empty_children ? : ++tn_info(n)->full_children;
>
> Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
Applied to net-next, thanks.
Powered by blists - more mailing lists