From nobody Wed Dec 17 19:49:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5536C30638 for ; Thu, 17 Aug 2023 14:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352193AbjHQOpO (ORCPT ); Thu, 17 Aug 2023 10:45:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352232AbjHQOpF (ORCPT ); Thu, 17 Aug 2023 10:45:05 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F2F2D78 for ; Thu, 17 Aug 2023 07:45:01 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:d85a:258d:2c59:b44]) by laurent.telenet-ops.be with bizsmtp id aeky2A00E4QHFyo01ekyys; Thu, 17 Aug 2023 16:44:59 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qWeF1-000u8j-7E; Thu, 17 Aug 2023 16:44:58 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWeF8-007SBY-O3; Thu, 17 Aug 2023 16:44:58 +0200 From: Geert Uytterhoeven To: linux-m68k@lists.linux-m68k.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 4/6] m68k: math-emu: Replace external declarations by header inclusion Date: Thu, 17 Aug 2023 16:44:51 +0200 Message-Id: <163bc2f64b5a3dd7b96a12aaca6733b408ddc880.1692283195.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Replace the (incorrect) external declarations by an inclusion of the appropriate header file. Semantically, the "src" parameters of the various fp_*() functions are constant. However, they cannot actually be const as most of these functions perform a normalization step first. As the fp_one constant passed to fp_add() is already normalized, it is safe to cast away its constness when making the function call. Signed-off-by: Geert Uytterhoeven --- arch/m68k/math-emu/fp_log.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index a8eac8c81757d22e..2426634c4ba74377 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -15,6 +15,7 @@ =20 */ =20 +#include "fp_arith.h" #include "fp_emu.h" =20 static const struct fp_ext fp_one =3D @@ -22,9 +23,6 @@ static const struct fp_ext fp_one =3D .exp =3D 0x3fff, }; =20 -extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *sr= c); -extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *sr= c); - struct fp_ext * fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) { @@ -70,7 +68,8 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) * sqrt(x) =3D 1 + 1/2*(x-1) * =3D 1/2*(1+x) */ - fp_fadd(dest, &fp_one); + /* It is safe to cast away the constness, as fp_one is normalized */ + fp_fadd(dest, (struct fp_ext *)&fp_one); dest->exp--; /* * 1/2 */ =20 /* --=20 2.34.1