Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3100194ybi; Thu, 18 Jul 2019 21:02:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq9gapqq8VqEqL/m6oStshOMKNZmOl3KUoD7GVT8s3pqIxb6t9hI7Cfp4F2FZCArIQh3PU X-Received: by 2002:a17:90a:2163:: with SMTP id a90mr52541063pje.3.1563508937459; Thu, 18 Jul 2019 21:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508937; cv=none; d=google.com; s=arc-20160816; b=P38BpKQHLYb5wBrxpY+FL6I2Io1Nrp2iwvIrkpOgLFH0UAW80DRsqMkoluA2w8d7jP Ii24EfdZhUVxuQJUT8V8zUKGdEMusocZImtIEFDZnXiwcrUAZYFjlPFheCoXsUZzZBZZ tiVAVWX1Mky6HnFYYqS/36GjDTKEya3i+BOO5ZlqIATG+9Mv/ePcML3c4mLzJJKg8m8J epz5tO9QenkaxJU6y2BiL28v4FTO6pGuldZWHD8u60LxOaGHQt4VTLs0P9f0SiqtiVC5 l+Kout5ZwB0ahBF1VEu0F1QEE8kvfGToC6s+0fFiT5iaSTnsU3S26BduNa00RiApgarq bOGg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5Dlo2RJJ/18ZqwPEw8FfDZRRTHMTwRVAM6gbQPEsYpo=; b=hlUn1JhMQVse5MkGSB1ifQcacsc0lTMtG4JCUKmYMZuzwFa6W7uzWvpy1Da1n0TIUy gLFwc1Cg46bmzoN5PkmPrE40IGbbOD5viwMbW7UJ4xAXjiferE75jwZK/KuGBl6OhLGC F2wq32LYIV9al9+hkrY+RWA+vjUhUnClJ8u/y4VuwQeSQd0p4/IJofSUOs6sKrk5ISZJ /Rso0tlK/eRV8VvDB4MVEVYXULe/hL6/w15V8uJWEiIMy5a6rUkUwAfuwGXheAbLTtbp Svfv5PfVO9VkD3DUg5VvqV+jmva8Ugx8zWv4yyAZgTOZr6X8VvjtYaHUDDirCM3siKcg sv7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1lG41vMU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si1184318plp.171.2019.07.18.21.02.02; Thu, 18 Jul 2019 21:02:17 -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=1lG41vMU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728841AbfGSD7m (ORCPT + 99 others); Thu, 18 Jul 2019 23:59:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:59316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728815AbfGSD7j (ORCPT ); Thu, 18 Jul 2019 23:59:39 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CD5D218A6; Fri, 19 Jul 2019 03:59:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508778; bh=WWiRGUwXypUjI0ab0plnKjXWJt7EYhDzkrUQgknLJxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1lG41vMUR/3ZUX8X+ePfCgD32jLqXXiV4EdQsi7CLfTA6WX/gajnmxBBSXbvWbPnX Apj2tX8T1GMngAGN9AY2qzm3AQMNR1RLJi8UYECPdmt97wScdD+sMvvEWeb6p7HBHz VxXuRZk8xy++gbLBOQnkBTyuyVtVKal5UAp8woPs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Huckleberry , Matthias Kaehlcke , Douglas Anderson , Nick Desaulniers , Alexander Duyck , "David S . Miller" , Sasha Levin , linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 5.2 085/171] net/ipv4: fib_trie: Avoid cryptic ternary expressions Date: Thu, 18 Jul 2019 23:55:16 -0400 Message-Id: <20190719035643.14300-85-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Huckleberry [ 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