Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3799335ybi; Mon, 29 Jul 2019 12:51:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQYv2XXEjaVrU6y6oszdVrh3YqWMxy9TrBDNo40uWBaQ1XNMV4TIbCIP5cDx5bQrCOUmYm X-Received: by 2002:a17:90a:d3d4:: with SMTP id d20mr116367185pjw.28.1564429911790; Mon, 29 Jul 2019 12:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429911; cv=none; d=google.com; s=arc-20160816; b=KHQMdSzyOxyasCSSe7wh7yJ46MH2sjScjSYMeqfbzZjY1PdN3gTsfFIqi+AG1qL6aU vBomPZpwoRkWwXTy4nMZQ9v1y9WFcyRS36GK1QyMg0FrBdmgFzpp+ZbaknqQp8F/CPm9 d8G3WEMrQNE1+PTR+DfN20CpAfZOek/03pByKlms/Fy88DDHcoclzB3CMBGvs24qkDin ufPJky5PYPnRgqc1IDIK0k3aUi1Wcq357kSr3k4jAfTgG75pjvdBvA+21LB+CFh8xsU5 iUgJ0G9bWA7vVreY2MtIcqI/AJOwkCl7Yg44PtWYNG3nI9b+7X9+sFj5bdIOWmXZVtfb GIoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mAH9RmyHFp7QYwdA8HSoAAqIbAx+d5mfvpbwjQQqtxk=; b=DP5AwvKDaK6MjXRrYx6VBJQxVFCTJ4H1ssilEE5Em5xgTKCY8KMdIEhwIlIApOf+Su Il4t7wgOCZZgU0lIgsbuuYzjvzUpu3TqQj03bxjHW5IIkYppU0P8zbReOT+a0oIeBk6o uu0+quz65Qb6n9vA9eHA8MAZBbgJayuij5w/rBphJJ5Cuu/aQq9F0xHKkSqvll2Z+VID gVMdtI79ffJqIiJqFDM+ntkWvG5kyWkHzBBsfn+ET8knFJatKW1xJPwllzQ+BPpGdYxk D0o2pK9gTAvLt4mIC6zRnN9OR+dgtw/NePhMn9IWmwb0yELB/kG+eH5bbjGvjgrjKrbx R+mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uZ4h28bW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si24708533plw.37.2019.07.29.12.51.36; Mon, 29 Jul 2019 12:51:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uZ4h28bW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390486AbfG2TtK (ORCPT + 99 others); Mon, 29 Jul 2019 15:49:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:39562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390478AbfG2TtI (ORCPT ); Mon, 29 Jul 2019 15:49:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 401332171F; Mon, 29 Jul 2019 19:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429747; bh=0K6RHdAK4FBoesDM4xqngRUIE526J2Hk2OhVGo0EqLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uZ4h28bWIAHZ3n5MjD8ZkGqW1Eg2Jc848Hq214RptRXfmCD1d4EjVUleDb9j+qOAb 5mbTPX2S6VKyRsabpqXrOJJiHoZ39rgwRJ7LV3Xm7tZlIJQYt3EwxKpwuE2/vhD11X BQwDwWbj3Bh8MOswE2s/hc8hsl7wHDijlHjdEycE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Douglas Anderson , Nick Desaulniers , Alexander Duyck , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 083/215] net/ipv4: fib_trie: Avoid cryptic ternary expressions Date: Mon, 29 Jul 2019 21:21:19 +0200 Message-Id: <20190729190753.998851246@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 25cec756891e8733433efea63b2254ddc93aa5cc ] 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; Fixes: 95f60ea3e99a ("fib_trie: Add collapse() and should_collapse() to resize") Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Reviewed-by: Nick Desaulniers Acked-by: Alexander Duyck Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- scripts/Makefile.extrawarn | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 3ab8d1a303cd..b293246e48fe 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -68,7 +68,6 @@ else ifdef CONFIG_CC_IS_CLANG KBUILD_CFLAGS += -Wno-initializer-overrides -KBUILD_CFLAGS += -Wno-unused-value KBUILD_CFLAGS += -Wno-format KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-format-zero-length -- 2.20.1