Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1337880pxb; Wed, 10 Feb 2021 06:18:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCv7A1CdEm0Fq9cz30Ql7lC7FV0aAxNa+gz1yU4+3tor6/ezPZ7QzZZoQZVyBDtKCDqQa6 X-Received: by 2002:a50:ec06:: with SMTP id g6mr3374291edr.12.1612966694059; Wed, 10 Feb 2021 06:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612966694; cv=none; d=google.com; s=arc-20160816; b=z1rIrBn1WcFw3VLGuXbZOuCi9D/4F5Zhizbl31LeFGxm++unE0nKK9uQNDlm7hq1Nv svlbmOszuuwP11QDNY1o0T3ZK9iGNjzpLnTJDymF0JHsh2NFXv6w0mFhYfnQOCVdrbET 2lFdwNmG1EIxbEoTyhdfSTmS4lIG2HLaFPeXsurJMgArkQ/JUY7K03Lma0UPwmV1hqUM nfvAruQt4iaRop4VXu3vKDPOM9FuPi7ezsnIKlD3w0AFjKSoo5LiWZ+6QcZhhE+OUlwm Ts5upJS9VpVjgDGWdwL2O25xhm6HAGIw0K3HxLAHM/IsFTuGRa3PghjxuTZnrNs7DWiY 0PdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wOyuwRtLUkGFLi2IRRKYoqSTg7llLbOzhigd5tCpv0M=; b=h9SoKitQt+HAuixPHzNiVBVML7Lakj14qz+zYwIDBhIRaQfSgYEoI3j75ZxwDuiYsb aGZ1dyRuhraqBcMljceDGZaOWT022xaFobJ++detCqK7FvVobbyehwYeLbgA149LNgNw 9tZnYgi40gEsuFuQyrd3D6GuQYfnfl8UnzwruU6DK4gCYEuLeZ18imeUTksahwoL9cmZ WK85pqHFGEc+adSGTONKbcSB5nnd5u946ds+2gIC+I5MGay9zCXELYhbhS/q5BrML0vh 3GtBA/f4XGsMju59432mCblwQynJixmUu2vcPKRw2T733R/TjV+Xei+J5KY40+o7/rK2 eoKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si1363044ejv.558.2021.02.10.06.17.50; Wed, 10 Feb 2021 06:18:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231695AbhBJOOp (ORCPT + 99 others); Wed, 10 Feb 2021 09:14:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231993AbhBJOMa (ORCPT ); Wed, 10 Feb 2021 09:12:30 -0500 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 629DEC061756 for ; Wed, 10 Feb 2021 06:11:46 -0800 (PST) Received: from ramsan.of.borg ([84.195.186.194]) by andre.telenet-ops.be with bizsmtp id TSBj2401F4C55Sk01SBjmq; Wed, 10 Feb 2021 15:11:44 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1l9qDX-005Hsz-DM; Wed, 10 Feb 2021 15:11:43 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1l9qDW-006Jqm-SB; Wed, 10 Feb 2021 15:11:42 +0100 From: Geert Uytterhoeven To: Russell King , Michal Simek , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/4] asm-generic: div64: Remove always-true __div64_const32_is_OK() Date: Wed, 10 Feb 2021 15:11:39 +0100 Message-Id: <20210210141140.1506212-4-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210210141140.1506212-1-geert+renesas@glider.be> References: <20210210141140.1506212-1-geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit cafa0010cd51fb71 ("Raise the minimum required gcc version to 4.6"), the kernel can no longer be compiled using gcc-3. Hence __div64_const32_is_OK() is always true, and the corresponding check can thus be removed. While at it, remove the whitespace error that hurts my eyes, and add the missing curly braces for the final else statement, as per coding style. Signed-off-by: Geert Uytterhoeven --- include/asm-generic/div64.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h index a3b98c86f077482d..10a8b1342fb0387b 100644 --- a/include/asm-generic/div64.h +++ b/include/asm-generic/div64.h @@ -55,17 +55,11 @@ /* * If the divisor happens to be constant, we determine the appropriate * inverse at compile time to turn the division into a few inline - * multiplications which ought to be much faster. And yet only if compiling - * with a sufficiently recent gcc version to perform proper 64-bit constant - * propagation. + * multiplications which ought to be much faster. * * (It is unfortunate that gcc doesn't perform all this internally.) */ -#ifndef __div64_const32_is_OK -#define __div64_const32_is_OK (__GNUC__ >= 4) -#endif - #define __div64_const32(n, ___b) \ ({ \ /* \ @@ -228,8 +222,7 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); is_power_of_2(__base)) { \ __rem = (n) & (__base - 1); \ (n) >>= ilog2(__base); \ - } else if (__div64_const32_is_OK && \ - __builtin_constant_p(__base) && \ + } else if (__builtin_constant_p(__base) && \ __base != 0) { \ uint32_t __res_lo, __n_lo = (n); \ (n) = __div64_const32(n, __base); \ @@ -239,8 +232,9 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); } else if (likely(((n) >> 32) == 0)) { \ __rem = (uint32_t)(n) % __base; \ (n) = (uint32_t)(n) / __base; \ - } else \ + } else { \ __rem = __div64_32(&(n), __base); \ + } \ __rem; \ }) -- 2.25.1