From patchwork Thu Aug 17 14:44:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 135938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp918316vqi; Thu, 17 Aug 2023 12:10:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2MuURU9cEUeLpdfy4tr3G5sp50ol6T2qw8TRfmsQBDrZ/59C1Dikpad04SPTMDLRGrxf/ X-Received: by 2002:a05:6a20:7faa:b0:12e:5f07:7ede with SMTP id d42-20020a056a207faa00b0012e5f077edemr773332pzj.41.1692299420767; Thu, 17 Aug 2023 12:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692299420; cv=none; d=google.com; s=arc-20160816; b=u5l9694AcMGdIoq9QsSGhEngg+jo5y56Ebj+G5r+lx1JYtv0Vwo3kKLAwPes7QsqCu eqSEfUiZbbXaC37IJJEtpasrfdZSXtlpihYmjif6GgSuNK3URFrQILGNo1go7CjcG18t xxR27ouSNKVVOTJB0V6fhBo03hzkwKAgpkec4IcUjCYfxP8/GBDQx18m2dyYa3Wro5Bc cLAs/ErAYpIhuH+Pj1Wx/+lSdZFUkVBducXaeWjNtB6TCf5/qxw5Dev0fdGS49fypFFr qPEqpVJneRZjD2Z2JBgjV3va986mNRUaE5FOw6XHxuMD4tcooQb75lFrYKqwNPLMtI3D AdEQ== 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=X58ZPQrbF9XWdPK/fZlZWnXPd4BthpV8YwB1oWJftVE=; fh=XoO3hytbiPkfujDC6fHw6R1/7GfTgI0E/4Cn/U2A2Do=; b=h3uoOtuEV+stK1bWU2HEJklXsDnGagjgYzkb+0UZGhHqYQth42Te+fD3B5rBm9Wkpi BG88xHJ12lOuqC2/oJvlclgG8wMM2mvGbv5Tk6naB63Xv0YQpTviMyF3xMtnM43OqKPs qqURdQZk6/uCuX3iZGHU+g9I00hzMVUby5kR5DjLFeER84ue4VZq83zm40VrK/YU3Xcc 0SQVQ0duP78OIjkDmO6y5v537SLutZcwqSMrGSU7izx6GmzSw9JOUHWRbpLeWeZ4jbYA G9mut604yoRKR8n5RqNdQqqpTK16gvL5CZ9WA/prXWGKVhW4T9mTUx88E6sdUQfJmUNz HfIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az1-20020a056a02004100b0056531bfc660si73403pgb.143.2023.08.17.12.10.05; Thu, 17 Aug 2023 12:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352227AbjHQOpR (ORCPT + 99 others); Thu, 17 Aug 2023 10:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352225AbjHQOpD (ORCPT ); Thu, 17 Aug 2023 10:45:03 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07A27BF 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 albert.telenet-ops.be with bizsmtp id aeky2A00h4QHFyo06eky8H; 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-000u8d-5u; Thu, 17 Aug 2023 16:44:58 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWeF8-007SBM-MH; 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 1/6] m68k: math-emu: Fix incorrect file reference in fp_log.c Date: Thu, 17 Aug 2023 16:44:48 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774504557455362512 X-GMAIL-MSGID: 1774504557455362512 The file comment header refers to the wrong file. Signed-off-by: Geert Uytterhoeven --- arch/m68k/math-emu/fp_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 0663067870f2a916..a8eac8c81757d22e 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -1,6 +1,6 @@ /* - fp_trig.c: floating-point math routines for the Linux-m68k + fp_log.c: floating-point math routines for the Linux-m68k floating point emulator. Copyright (c) 1998-1999 David Huggins-Daines / Roman Zippel. From patchwork Thu Aug 17 14:44:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 135966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1054352vqi; Thu, 17 Aug 2023 17:00:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4lDLSY/LKQGeYJE1YXnfxkbsPJlRpb1K0i7DxIfKfG8utFY1ZBoQyGTDzW3EmfkH7pVxi X-Received: by 2002:a05:6808:9b8:b0:3a7:b011:8960 with SMTP id e24-20020a05680809b800b003a7b0118960mr1113032oig.40.1692316833119; Thu, 17 Aug 2023 17:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692316833; cv=none; d=google.com; s=arc-20160816; b=wgE8uJgWEzminxWdg+vkLY4QCpuITJuhOw9a8PrROfVQBJq+ObqbMOkkjGqm1kDdsI tKcuqtEuyVQUpXpAz9wz/WwybqBDWHXFCvThxrw9ffNc4xD0VoWD38/D5RguFiM4UmHM 5TIUhu3mqkhBOwXZNSYPNidNaM2Bb8U7QdNgTWdwszFdYYeaz1rZ/45oj6LbEuD66fMU sOr41eHY7hdSRMgJZRjUbkO9SbGdAGu/R0JHb7k9u++OQoImv+EChcZ/MvBhSkrnYRhV cY+Tu/A+GZAgBu5/2gQgRvJ0hpbMLMSM0aSvf5bwOAvksmFeGr4sZbeXiFKpxF2EQGQ+ mkcg== 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=UefnlxGvf73AnxTra5B3na92akDKT003jNhTDd7FSEk=; fh=XoO3hytbiPkfujDC6fHw6R1/7GfTgI0E/4Cn/U2A2Do=; b=IQyzmUSzfD9ycxBo7pxA0TGp4w98t6McjF9vLdS/KbQ/SxbzhsSCNMobjV0c3fVTfk H3ZbeuqkA+1/vlNx/89+8a5CgbCr4nK1JBdIajcr/n46Jr58nHzuAGcdLQ2mCyFwvt5b 02rnKJwK1sxNNuuF9DScYVrsFyF16wnQSW8b3qvK3w62jxoB7ZeUmg0zLbLOT32zcCAh 8GUPqAYfV2fXLMQ2gsF1IVn5Fg3eBpoAvYSoTIVHXtICdEttd2aobtlzcpvayHSenKch bsWQlthBiEtLtwzL/mvtkYG9cyC+IX/x4hzhRRre9cOWaSFJFQb87bOwUiD/LBwgCNM4 do5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a632704000000b00563f4e46f7esi382615pgn.287.2023.08.17.17.00.19; Thu, 17 Aug 2023 17:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352166AbjHQOpI (ORCPT + 99 others); Thu, 17 Aug 2023 10:45:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352226AbjHQOpE (ORCPT ); Thu, 17 Aug 2023 10:45:04 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F97E94 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 albert.telenet-ops.be with bizsmtp id aeky2A00f4QHFyo06eky8G; 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-000u8f-69; Thu, 17 Aug 2023 16:44:58 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWeF8-007SBP-Mu; 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 2/6] m68k: math-emu: Sanitize include guards Date: Thu, 17 Aug 2023 16:44:49 +0200 Message-Id: <8c84c8bf06c0c1e463c47f071891e2e83d5abdd2.1692283195.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774522815380060497 X-GMAIL-MSGID: 1774522815380060497 Some include guards start with an underscore, others don't. Some comments do not match the actual include guard. Make them uniform, adhering to the "FP__H" format. Signed-off-by: Geert Uytterhoeven --- arch/m68k/math-emu/fp_arith.h | 6 +++--- arch/m68k/math-emu/fp_trig.h | 6 +++--- arch/m68k/math-emu/multi_arith.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 0fd3ed217f668652..85bdd83b9dd667a8 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -12,8 +12,8 @@ */ -#ifndef FP_ARITH_H -#define FP_ARITH_H +#ifndef _FP_ARITH_H +#define _FP_ARITH_H /* easy ones */ struct fp_ext * @@ -47,4 +47,4 @@ fp_fintrz(struct fp_ext *dest, struct fp_ext *src); struct fp_ext * fp_fscale(struct fp_ext *dest, struct fp_ext *src); -#endif /* FP_ARITH__H */ +#endif /* _FP_ARITH_H */ diff --git a/arch/m68k/math-emu/fp_trig.h b/arch/m68k/math-emu/fp_trig.h index af8b247e9c982874..52f0cc31cfe49cb7 100644 --- a/arch/m68k/math-emu/fp_trig.h +++ b/arch/m68k/math-emu/fp_trig.h @@ -15,8 +15,8 @@ */ -#ifndef FP_TRIG_H -#define FP_TRIG_H +#ifndef _FP_TRIG_H +#define _FP_TRIG_H #include "fp_emu.h" @@ -29,4 +29,4 @@ they return a status code, which should end up in %d0, if all goes well. */ -#endif /* FP_TRIG__H */ +#endif /* _FP_TRIG_H */ diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index 232f58fe3483d2be..ed2434fcfb1ef46e 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -15,8 +15,8 @@ implement the subset of integer arithmetic that we need in order to multiply, divide, and normalize 128-bit unsigned mantissae. */ -#ifndef MULTI_ARITH_H -#define MULTI_ARITH_H +#ifndef _MULTI_ARITH_H +#define _MULTI_ARITH_H static inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt) { @@ -285,4 +285,4 @@ static inline void fp_putmant128(struct fp_ext *dest, union fp_mant128 *src, } } -#endif /* MULTI_ARITH_H */ +#endif /* _MULTI_ARITH_H */ From patchwork Thu Aug 17 14:44:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 135954 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp967951vqi; Thu, 17 Aug 2023 13:46:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlZRHrUTOXFnvGjJUq9OoNUxOBMlNJxppQ2dqJUrYpzpmOcjDbS7m75ikUQq+m036aH4qj X-Received: by 2002:a05:6a00:1510:b0:687:2be1:e2f6 with SMTP id q16-20020a056a00151000b006872be1e2f6mr740633pfu.16.1692305215600; Thu, 17 Aug 2023 13:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692305215; cv=none; d=google.com; s=arc-20160816; b=iMMKBCWq6uzEj3ha4U2DKLOiu39vULPq0K5kJ43fziwd2K/wTze1cy6MAW7hu7Bxcz enrwS1IQ+IO/oVwy2BgZemBGHEExLM1m86CPfQhQpf9SVZADotuq8yJSw1oFT5DxLWJ7 bmP1S+2EXYsFyOaFb+VJ4ufmCdmk+ZnNr20/oaZcZKCu1EcXp9XA/8+x1V94vj7SeZOe hdPwtEtLYedEDGQk0fcPOwQsnN/7D619ets93mKjHbWrxKcWqRy7M1nTYHolXpQHIhHr hgXQuTAesDBs0NvVFwb2CO8blciMid8drk3/TSJ/FjvfHPh5YI2DlLvKABD8FF/MuWmE VS+A== 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=D32/Gt5ae2l+8cnr74ADWrWFHcTK8Ov0zyEazBy1puE=; fh=XoO3hytbiPkfujDC6fHw6R1/7GfTgI0E/4Cn/U2A2Do=; b=mtzBw26cSbkfB6ppr7tQ4NLzTCMKAi1EovvQPV3ryEPwWFhMXfaNBQSyb1viydgaJK IzRQWW/GHtL9AlGMXuScj8VafpUsPiJU/STjhRBMCv+s7jvHst7jRv3raxH6v34sTxna 7z8Qa75wy/3IfBDmNhQ/+gi4qKQ9ciyQsxzGFyyjppWaKMA+QTuXp0FTtxvkBJu1JsGQ XgYaRao5SqELnMG1klbUiQr1yUiKNkV98ZraNbxf+vS2D2RuPqxtHjygi97jBWQx50F5 CvsE89FcVYbrAeNkeL3d8OyQqVV6Y1yBnqkJ6QLtAiXqKH4m/y2dm0CinPV9YA4NOFnX RbGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fb20-20020a056a002d9400b00653b5ab16c3si244745pfb.265.2023.08.17.13.46.41; Thu, 17 Aug 2023 13:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352200AbjHQOpP (ORCPT + 99 others); Thu, 17 Aug 2023 10:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352224AbjHQOpD (ORCPT ); Thu, 17 Aug 2023 10:45:03 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FBF1C7 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 albert.telenet-ops.be with bizsmtp id aeky2A00g4QHFyo06eky8J; 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-000u8h-6m; Thu, 17 Aug 2023 16:44:58 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWeF8-007SBU-NT; 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 3/6] m68k: math-emu: Make multi_arith.h self-contained Date: Thu, 17 Aug 2023 16:44:50 +0200 Message-Id: <2efd6610e97dd1621e7d28bf87cb79173285545d.1692283195.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774510633794582534 X-GMAIL-MSGID: 1774510633794582534 Add the missing #include "fp_emu.h". Signed-off-by: Geert Uytterhoeven --- arch/m68k/math-emu/multi_arith.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index ed2434fcfb1ef46e..f7d9e49fe259d8c9 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -18,6 +18,8 @@ #ifndef _MULTI_ARITH_H #define _MULTI_ARITH_H +#include "fp_emu.h" + static inline void fp_denormalize(struct fp_ext *reg, unsigned int cnt) { reg->exp += cnt; From patchwork Thu Aug 17 14:44:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 135936 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp902323vqi; Thu, 17 Aug 2023 11:40:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyXSiyowSSFXt/FmMPDwQJy3jQ5RixSUauw2Y00q5upQoQ07BSUhmsa4sGUCSxIQ0DpyqU X-Received: by 2002:a05:6512:12c1:b0:4ff:8a04:b251 with SMTP id p1-20020a05651212c100b004ff8a04b251mr135081lfg.50.1692297630847; Thu, 17 Aug 2023 11:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692297630; cv=none; d=google.com; s=arc-20160816; b=CRYF4fSLugKseSRHh4P3EToRp+oM7EkCLAu4k/uROHkWOHyXxBqtrerJQgvl5O9GAa 1b33ZfRNdrPQc7V72ssorInC3xdfYZFm2N7pVKOazFeTOTlnzyOQnx+E+aq1pI1J+Igo 1IBHlwN8G5gHjSu3x77Dala7Ta8lBMpb5TLfTBEYBcy/1UwZYU5v824kzBUUQHtwyxSR u60VV6FtVDzu2IlSjdee8PwqWfMeBOEeArNH+VVdb0NRJ3GGjTmdSz2WCSHCcOo76fw6 qVpOdNXVvv71lsb7MFWda8m6dC84/aVqVCQ4TSeJnaR/agB62zLL6197L6Bltocw5MX/ nhVQ== 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=/EnrP7OMFMcvu1jrT1Xv9gRi31JmLnFZzMvBqgbRChY=; fh=XoO3hytbiPkfujDC6fHw6R1/7GfTgI0E/4Cn/U2A2Do=; b=Al8Abw4ODPFxXMz1BE3/qXjjqztb3moLWKKVcW6FBlGtI+/89SYi49ig1szAiHl8A6 zk7+9TrdyKpnrUiv3HORv2g2aHSq22+IfTcJ7pefffCKic9Ptj3MamAN/bZ//Zm/NeeT C+ff544/m1gBACNiFO3WSabrVEmsr9URFHRbKCN6FhREbtWKiikOvzVeYpWxWVDoqApP 7s/8f1McRAk7glMUniqZdHDrhIP725hwCd+zqJEJN9jTZIl65Df2Dc4H3Bm0qI75KWG2 XzPme1mmlSiPxxBvKj2dJxv/sX1VZMyb772mZuz0Enak2dJ5FydEmP3spa7IlIkiZDyT eRhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020aa7d7ca000000b0052340f2fdd5si92115eds.269.2023.08.17.11.40.07; Thu, 17 Aug 2023 11:40:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352184AbjHQOpO (ORCPT + 99 others); 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774502680625292904 X-GMAIL-MSGID: 1774502680625292904 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 @@ */ +#include "fp_arith.h" #include "fp_emu.h" static const struct fp_ext fp_one = @@ -22,9 +23,6 @@ static const struct fp_ext fp_one = .exp = 0x3fff, }; -extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); -extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); - 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) = 1 + 1/2*(x-1) * = 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 */ /* From patchwork Thu Aug 17 14:44:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 135918 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp850330vqi; Thu, 17 Aug 2023 10:11:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9QteO7oUFzyHSa6hJsAw2ikDB/McqcBak/95zGn4gaKreVOw+2ch8+XwtFoJCFFHpUtmY X-Received: by 2002:a17:907:7628:b0:99e:f3:67ae with SMTP id jy8-20020a170907762800b0099e00f367aemr3605014ejc.31.1692292306264; Thu, 17 Aug 2023 10:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692292306; cv=none; d=google.com; s=arc-20160816; b=iweQJ7RWub5zx3l+ybmh22/CjhMNV0d+qZQ4Yl0GFMITWE403VnvH9eLUryMEImTD1 6++wFNJGuB27Y/YsMmGcv1MA+Bqa5kmBciHPmlA2aCQFA8/ZYomtvF2KtyUWqn0v0+6g 8WlRLmU/JmKQ3VxrFxBM/GPZf2Ji+UpS30VlPqW3yc1T1D+EF7ayCL+ewVuBocMzKEaO I9v8hGxreos0d/CoDlSjtOsFA4cRwYJ3SW3p6GAVmLEEQDNGkXD3ckPyMZe+Lt7pfU3b R3+8Y8/fDJqH5CqgEVki5mOm4N5VH7IzAf1mUqpNd8icx7yaUySiyS+Y7WgHGZ1B2FvQ iyhw== 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=xb6js8PpTxRyK4NHOz0XWmPuOzHfYa8qXaUa4/Y7XAc=; fh=XoO3hytbiPkfujDC6fHw6R1/7GfTgI0E/4Cn/U2A2Do=; b=itVfjyyGSCgnq+DhVAIRhmRIYoZOjuF4Eg0OnUmflOwdiHKdb2yv3v5coXrdW9odS5 WhhsLGwrAVwHVuScyUY0vVvBNDR0qOZKL0UbeQEouBorXVoK8sZdDRAUiZRrkTsvhuLd miy1berWJbEAulR+w4IrTsabpdHj+XkztVGHAzwK6u4ZSI6eK5Z6twSnD6phFPPKF2zi wCkwkObzjjT130pUzqtBwoofTOUqSwofg9eljV8g90nsSKY0sxZET8PpM+tME2JRfxcE RaAG27wzECCdHmCMgs2teTE2MVWkPzWxZw/v3Br2FtDvn/uPU7JTTAtqnY/0bRzZbWLg SMpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oq14-20020a170906cc8e00b0099cf91fe29esi12492699ejb.72.2023.08.17.10.11.19; Thu, 17 Aug 2023 10:11:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352209AbjHQOpQ (ORCPT + 99 others); Thu, 17 Aug 2023 10:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352234AbjHQOpG (ORCPT ); Thu, 17 Aug 2023 10:45:06 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16553EE 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 michel.telenet-ops.be with bizsmtp id aeky2A00L4QHFyo06ekyY8; 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-000u8o-7u; Thu, 17 Aug 2023 16:44:58 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWeF8-007SBc-Of; 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 5/6] m68k: math-emu: Reformat function and variable headers Date: Thu, 17 Aug 2023 16:44:52 +0200 Message-Id: <11506b9225e281f2453a83a02ac4793d0e58b609.1692283195.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774497097430162727 X-GMAIL-MSGID: 1774497097430162727 Make the code shorter and easier to read. Signed-off-by: Geert Uytterhoeven --- arch/m68k/math-emu/fp_arith.c | 49 +++++++++++-------------------- arch/m68k/math-emu/fp_arith.h | 39 +++++++++---------------- arch/m68k/math-emu/fp_log.c | 36 ++++++++--------------- arch/m68k/math-emu/fp_trig.c | 54 ++++++++++++----------------------- 4 files changed, 60 insertions(+), 118 deletions(-) diff --git a/arch/m68k/math-emu/fp_arith.c b/arch/m68k/math-emu/fp_arith.c index f4a06492cd7a118a..799c450fe3223955 100644 --- a/arch/m68k/math-emu/fp_arith.c +++ b/arch/m68k/math-emu/fp_arith.c @@ -28,8 +28,7 @@ const struct fp_ext fp_Inf = /* let's start with the easy ones */ -struct fp_ext * -fp_fabs(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fabs(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fabs\n"); @@ -40,8 +39,7 @@ fp_fabs(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fneg(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fneg(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fneg\n"); @@ -57,8 +55,7 @@ fp_fneg(struct fp_ext *dest, struct fp_ext *src) /* fp_fadd: Implements the kernel of the FADD, FSADD, FDADD, FSUB, FDSUB, and FCMP instructions. */ -struct fp_ext * -fp_fadd(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fadd(struct fp_ext *dest, struct fp_ext *src) { int diff; @@ -117,8 +114,7 @@ fp_fadd(struct fp_ext *dest, struct fp_ext *src) Remember that the arguments are in assembler-syntax order! */ -struct fp_ext * -fp_fsub(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsub(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fsub "); @@ -127,8 +123,7 @@ fp_fsub(struct fp_ext *dest, struct fp_ext *src) } -struct fp_ext * -fp_fcmp(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fcmp "); @@ -137,8 +132,7 @@ fp_fcmp(struct fp_ext *dest, struct fp_ext *src) return fp_fadd(&FPDATA->temp[1], src); } -struct fp_ext * -fp_ftst(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "ftst\n"); @@ -147,8 +141,7 @@ fp_ftst(struct fp_ext *dest, struct fp_ext *src) return src; } -struct fp_ext * -fp_fmul(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src) { union fp_mant128 temp; int exp; @@ -225,8 +218,7 @@ fp_fmul(struct fp_ext *dest, struct fp_ext *src) Note that the order of the operands is counter-intuitive: instead of src / dest, the result is actually dest / src. */ -struct fp_ext * -fp_fdiv(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src) { union fp_mant128 temp; int exp; @@ -306,8 +298,7 @@ fp_fdiv(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) { int exp; @@ -363,8 +354,7 @@ fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) { int exp; unsigned long quot, rem; @@ -573,8 +563,8 @@ static void fp_roundint(struct fp_ext *dest, int mode) (which are exactly the same, except for the rounding used on the intermediate value) */ -static struct fp_ext * -modrem_kernel(struct fp_ext *dest, struct fp_ext *src, int mode) +static struct fp_ext *modrem_kernel(struct fp_ext *dest, struct fp_ext *src, + int mode) { struct fp_ext tmp; @@ -607,8 +597,7 @@ modrem_kernel(struct fp_ext *dest, struct fp_ext *src, int mode) fmod(src,dest) = (dest - (src * floor(dest / src))) */ -struct fp_ext * -fp_fmod(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fmod\n"); return modrem_kernel(dest, src, FPCR_ROUND_RZ); @@ -619,15 +608,13 @@ fp_fmod(struct fp_ext *dest, struct fp_ext *src) frem(src,dest) = (dest - (src * round(dest / src))) */ -struct fp_ext * -fp_frem(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_frem(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "frem\n"); return modrem_kernel(dest, src, FPCR_ROUND_RN); } -struct fp_ext * -fp_fint(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fint(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fint\n"); @@ -638,8 +625,7 @@ fp_fint(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fintrz(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fintrz(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fintrz\n"); @@ -650,8 +636,7 @@ fp_fintrz(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fscale(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fscale(struct fp_ext *dest, struct fp_ext *src) { int scale, oldround; diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 85bdd83b9dd667a8..65b11e3f452db9d6 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -16,35 +16,22 @@ #define _FP_ARITH_H /* easy ones */ -struct fp_ext * -fp_fabs(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fneg(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fabs(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fneg(struct fp_ext *dest, struct fp_ext *src); /* straightforward arithmetic */ -struct fp_ext * -fp_fadd(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fsub(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fcmp(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_ftst(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fmul(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fdiv(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fadd(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsub(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src); /* ones that do rounding and integer conversions */ -struct fp_ext * -fp_fmod(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_frem(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fint(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fintrz(struct fp_ext *dest, struct fp_ext *src); -struct fp_ext * -fp_fscale(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_frem(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fint(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fintrz(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fscale(struct fp_ext *dest, struct fp_ext *src); #endif /* _FP_ARITH_H */ diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 2426634c4ba74377..9f93efd5ef496770 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -18,13 +18,11 @@ #include "fp_arith.h" #include "fp_emu.h" -static const struct fp_ext fp_one = -{ +static const struct fp_ext fp_one = { .exp = 0x3fff, }; -struct fp_ext * -fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) { struct fp_ext tmp, src2; int i, exp; @@ -97,8 +95,7 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) { uprint("fetoxm1\n"); @@ -107,8 +104,7 @@ fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fetox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fetox(struct fp_ext *dest, struct fp_ext *src) { uprint("fetox\n"); @@ -117,8 +113,7 @@ fp_fetox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) { uprint("ftwotox\n"); @@ -127,8 +122,7 @@ fp_ftwotox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftentox(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftentox(struct fp_ext *dest, struct fp_ext *src) { uprint("ftentox\n"); @@ -137,8 +131,7 @@ fp_ftentox(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flogn(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flogn(struct fp_ext *dest, struct fp_ext *src) { uprint("flogn\n"); @@ -147,8 +140,7 @@ fp_flogn(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flognp1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flognp1(struct fp_ext *dest, struct fp_ext *src) { uprint("flognp1\n"); @@ -157,8 +149,7 @@ fp_flognp1(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flog10(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flog10(struct fp_ext *dest, struct fp_ext *src) { uprint("flog10\n"); @@ -167,8 +158,7 @@ fp_flog10(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_flog2(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_flog2(struct fp_ext *dest, struct fp_ext *src) { uprint("flog2\n"); @@ -177,8 +167,7 @@ fp_flog2(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fgetexp\n"); @@ -198,8 +187,7 @@ fp_fgetexp(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fgetman(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fgetman(struct fp_ext *dest, struct fp_ext *src) { dprint(PINSTR, "fgetman\n"); diff --git a/arch/m68k/math-emu/fp_trig.c b/arch/m68k/math-emu/fp_trig.c index 6361d0784df2aa0e..5f49de3737536af3 100644 --- a/arch/m68k/math-emu/fp_trig.c +++ b/arch/m68k/math-emu/fp_trig.c @@ -18,8 +18,7 @@ #include "fp_emu.h" #include "fp_trig.h" -struct fp_ext * -fp_fsin(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsin(struct fp_ext *dest, struct fp_ext *src) { uprint("fsin\n"); @@ -28,8 +27,7 @@ fp_fsin(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fcos(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcos(struct fp_ext *dest, struct fp_ext *src) { uprint("fcos\n"); @@ -38,8 +36,7 @@ fp_fcos(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftan(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftan(struct fp_ext *dest, struct fp_ext *src) { uprint("ftan\n"); @@ -48,8 +45,7 @@ fp_ftan(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fasin(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fasin(struct fp_ext *dest, struct fp_ext *src) { uprint("fasin\n"); @@ -58,8 +54,7 @@ fp_fasin(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_facos(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_facos(struct fp_ext *dest, struct fp_ext *src) { uprint("facos\n"); @@ -68,8 +63,7 @@ fp_facos(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fatan(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fatan(struct fp_ext *dest, struct fp_ext *src) { uprint("fatan\n"); @@ -78,8 +72,7 @@ fp_fatan(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsinh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsinh(struct fp_ext *dest, struct fp_ext *src) { uprint("fsinh\n"); @@ -88,8 +81,7 @@ fp_fsinh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fcosh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fcosh(struct fp_ext *dest, struct fp_ext *src) { uprint("fcosh\n"); @@ -98,8 +90,7 @@ fp_fcosh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_ftanh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_ftanh(struct fp_ext *dest, struct fp_ext *src) { uprint("ftanh\n"); @@ -108,8 +99,7 @@ fp_ftanh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fatanh(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fatanh(struct fp_ext *dest, struct fp_ext *src) { uprint("fatanh\n"); @@ -118,64 +108,56 @@ fp_fatanh(struct fp_ext *dest, struct fp_ext *src) return dest; } -struct fp_ext * -fp_fsincos0(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos0(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos0\n"); return dest; } -struct fp_ext * -fp_fsincos1(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos1(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos1\n"); return dest; } -struct fp_ext * -fp_fsincos2(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos2(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos2\n"); return dest; } -struct fp_ext * -fp_fsincos3(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos3(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos3\n"); return dest; } -struct fp_ext * -fp_fsincos4(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos4(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos4\n"); return dest; } -struct fp_ext * -fp_fsincos5(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos5(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos5\n"); return dest; } -struct fp_ext * -fp_fsincos6(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos6(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos6\n"); return dest; } -struct fp_ext * -fp_fsincos7(struct fp_ext *dest, struct fp_ext *src) +struct fp_ext *fp_fsincos7(struct fp_ext *dest, struct fp_ext *src) { uprint("fsincos7\n"); From patchwork Thu Aug 17 14:44:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 136218 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2260890vqi; Sat, 19 Aug 2023 18:02:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0Bt5CR2ONU8jST73HDuHRPaDJM0SCktZL3FK/0B2c//p7IuY3Vrd7+x/jSUX1zaM/o6aV X-Received: by 2002:a05:6871:1c6:b0:1bf:174b:a17e with SMTP id q6-20020a05687101c600b001bf174ba17emr4005230oad.22.1692493364932; Sat, 19 Aug 2023 18:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692493364; cv=none; d=google.com; s=arc-20160816; b=ghKX1885bCpEr7Cdq4vqBTFRZqUf1zdmo8XbV/X/10BKw3eml2ev2Ix4/WZTRsb3Vh GknI6b4kLNwEyQqEnKUmyQjvOsDGeBal+3XZsDsl85WKrKpRC+I0UcMzB/HHIOpVWFTn dcvRoEk0LwT0IxzWnoRW7WC13o2y+Uxjv5nzgtgQETiTVxgNqYJjAlQ/m8/7u5jNOZ0y 3xM8b0RZ0hxlnfRCP+V9XHpdW2x0CB9XQ5fRtfZmJE+QEQIPeOgOdpsYAJl5Q3xKO3Og 8BpdEIQc7P3ryV2xM+pHOjT5H2nUvVvUh2c72w3pP/iQzVePIKKzP+m6vHHbkZD6T5e1 4/1Q== 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=ERHvgLk07xkZ9y37nLDiWHTYZDFGmpvEzq2u6yPHS3g=; fh=XoO3hytbiPkfujDC6fHw6R1/7GfTgI0E/4Cn/U2A2Do=; b=LMkWvjLVqEOEwa3fwCwoh2/VkpXO5gNhzD6N+6QxSLKUEtt0Jc71ViGQx2jo7mwbE6 C+LQzPcK87oGOcNAI4nKHbWGg8OTJx4lfy0IuRTUo1XK371fVXlTB5XbeSH2PgsVwtDa E38yAQaeZULx/leYdKpC+QQ6M/LsaSEleTOnZKjhGOjY6vNsw/+TUZI0r7oxYmF0QeVw y2uLGJI8T7BJJ5DW4TdBupgtSMu6QO5aucdBOeC/ZSmZeIIvztjMZJsSuiYQpCUK+wYV Kc7u2fLLgwgypyUuKqTPPanxHUmlqPSIgEGIcD/djbv+5CcZzYmqrrfCWIfjie009ODE 7bzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bs191-20020a6328c8000000b00563e25c07c0si988397pgb.270.2023.08.19.18.02.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 18:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F6B9219097; Sat, 19 Aug 2023 11:31:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352176AbjHQOpK (ORCPT + 99 others); Thu, 17 Aug 2023 10:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352230AbjHQOpF (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 20AFB2727 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 aeky2A00F4QHFyo01ekyyt; 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-000u8r-8W; Thu, 17 Aug 2023 16:44:58 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWeF8-007SBg-PI; 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 6/6] m68k: math-emu: Add missing prototypes Date: Thu, 17 Aug 2023 16:44:53 +0200 Message-Id: <96c039640d76973ea762d79018de0bc75bbdc1dc.1692283195.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774707922915557263 X-GMAIL-MSGID: 1774707922915557263 When building with W=1: arch/m68k/math-emu/fp_arith.c:301:16: warning: no previous prototype for ‘fp_fsglmul’ [-Wmissing-prototypes] 301 | struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) | ^~~~~~~~~~ arch/m68k/math-emu/fp_arith.c:357:16: warning: no previous prototype for ‘fp_fsgldiv’ [-Wmissing-prototypes] 357 | struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) | ^~~~~~~~~~ CC arch/m68k/math-emu/fp_log.o ... Fix this by adding the missing prototypes to header files. Reported-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230810141947.1236730-17-arnd@kernel.org/ Signed-off-by: Geert Uytterhoeven --- arch/m68k/math-emu/fp_arith.h | 2 ++ arch/m68k/math-emu/fp_log.c | 1 + arch/m68k/math-emu/fp_log.h | 44 +++++++++++++++++++++++++++++++++++ arch/m68k/math-emu/fp_trig.h | 19 +++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 arch/m68k/math-emu/fp_log.h diff --git a/arch/m68k/math-emu/fp_arith.h b/arch/m68k/math-emu/fp_arith.h index 65b11e3f452db9d6..3f9c58b6d504f590 100644 --- a/arch/m68k/math-emu/fp_arith.h +++ b/arch/m68k/math-emu/fp_arith.h @@ -26,6 +26,8 @@ struct fp_ext *fp_fcmp(struct fp_ext *dest, struct fp_ext *src); struct fp_ext *fp_ftst(struct fp_ext *dest, struct fp_ext *src); struct fp_ext *fp_fmul(struct fp_ext *dest, struct fp_ext *src); struct fp_ext *fp_fdiv(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src); /* ones that do rounding and integer conversions */ struct fp_ext *fp_fmod(struct fp_ext *dest, struct fp_ext *src); diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c index 9f93efd5ef496770..71a8fc25575af810 100644 --- a/arch/m68k/math-emu/fp_log.c +++ b/arch/m68k/math-emu/fp_log.c @@ -17,6 +17,7 @@ #include "fp_arith.h" #include "fp_emu.h" +#include "fp_log.h" static const struct fp_ext fp_one = { .exp = 0x3fff, diff --git a/arch/m68k/math-emu/fp_log.h b/arch/m68k/math-emu/fp_log.h new file mode 100644 index 0000000000000000..c2bcfff11994cfb5 --- /dev/null +++ b/arch/m68k/math-emu/fp_log.h @@ -0,0 +1,44 @@ +/* + + fp_log.h: floating-point math routines for the Linux-m68k + floating point emulator. + + Copyright (c) 1998-1999 David Huggins-Daines / Roman Zippel. + + I hereby give permission, free of charge, to copy, modify, and + redistribute this software, in source or binary form, provided that + the above copyright notice and the following disclaimer are included + in all such copies. + + THIS SOFTWARE IS PROVIDED "AS IS", WITH ABSOLUTELY NO WARRANTY, REAL + OR IMPLIED. + +*/ + +#ifndef _FP_LOG_H +#define _FP_LOG_H + +#include "fp_emu.h" + +/* floating point logarithmic instructions: + + the arguments to these are in the "internal" extended format, that + is, an "exploded" version of the 96-bit extended fp format used by + the 68881. + + they return a status code, which should end up in %d0, if all goes + well. */ + +struct fp_ext *fp_fsqrt(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fetoxm1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fetox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftwotox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftentox(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flogn(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flognp1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flog10(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_flog2(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fgetexp(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fgetman(struct fp_ext *dest, struct fp_ext *src); + +#endif /* _FP_LOG_H */ diff --git a/arch/m68k/math-emu/fp_trig.h b/arch/m68k/math-emu/fp_trig.h index 52f0cc31cfe49cb7..1aae8ab1d41b15f2 100644 --- a/arch/m68k/math-emu/fp_trig.h +++ b/arch/m68k/math-emu/fp_trig.h @@ -29,4 +29,23 @@ they return a status code, which should end up in %d0, if all goes well. */ +struct fp_ext *fp_fsin(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcos(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftan(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fasin(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_facos(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fatan(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsinh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fcosh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_ftanh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fatanh(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos0(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos1(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos2(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos3(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos4(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos5(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos6(struct fp_ext *dest, struct fp_ext *src); +struct fp_ext *fp_fsincos7(struct fp_ext *dest, struct fp_ext *src); + #endif /* _FP_TRIG_H */