From patchwork Tue Oct 5 00:19:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12535151 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BE7DC433EF for ; Tue, 5 Oct 2021 00:19:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 826ED613AC for ; Tue, 5 Oct 2021 00:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230234AbhJEAVI (ORCPT ); Mon, 4 Oct 2021 20:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbhJEAVH (ORCPT ); Mon, 4 Oct 2021 20:21:07 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BD0C061745; Mon, 4 Oct 2021 17:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=vsKe9UWyhtw4LqDXqkhd7Dlz2yQ8HnD8Ggqg0cwCms8=; b=CLI0kUDVGj3h11GXz4duhSgG95 lDJ8UxNeHrjJjRsRI4W+JM11uxbnhK3rIKWWB8YEua0SvSGY1sVBsOmrCpiuZ+Cer/vrUNjvkmqXa lxB1DvncVG6PKvgOdCTftt3hb7twtQKvBL5y7Mcqw3TM2Iambmytt+aHDkwaRxVucERIGgXzWN1tA MQF/NUdJhGBoEFHfLYHFSp8CeTiP4hxm0Im42xDv7EXzwSg1vA4THKZLMJNdyGOXjfGB2tRSVJlOf DTWEC9hTTyRJHvJZOLQmi2rOxNTDtiYAGJORO72EM944EflNnh7QROk1gStGV7De16TvnFx6dAbWW TBs84Lgw==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXYAt-008SGi-FB; Tue, 05 Oct 2021 00:19:15 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Geert Uytterhoeven , Matt Fleming , Matt Fleming Subject: [PATCH 1/5 v3] sh: fix kconfig unmet dependency warning for FRAME_POINTER Date: Mon, 4 Oct 2021 17:19:10 -0700 Message-Id: <20211005001914.28574-2-rdunlap@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005001914.28574-1-rdunlap@infradead.org> References: <20211005001914.28574-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org FRAME_POINTER depends on DEBUG_KERNEL so DWARF_UNWINDER should depend on DEBUG_KERNEL before selecting FRAME_POINTER. WARNING: unmet direct dependencies detected for FRAME_POINTER Depends on [n]: DEBUG_KERNEL [=n] && (M68K || UML || SUPERH [=y]) || ARCH_WANT_FRAME_POINTERS [=n] Selected by [y]: - DWARF_UNWINDER [=y] Fixes: bd353861c735 ("sh: dwarf unwinder support.") Signed-off-by: Randy Dunlap Cc: Matt Fleming Cc: Matt Fleming Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: John Paul Adrian Glaubitz Cc: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Tested-by: John Paul Adrian Glaubitz --- v2: drop Paul Mundt from Cc: list; add this previously sent patch to the series; add more Cc's; v3: renumber, rebase, and resend; add Rev-by and Tested-by; arch/sh/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) --- linux-next-20211001.orig/arch/sh/Kconfig.debug +++ linux-next-20211001/arch/sh/Kconfig.debug @@ -54,6 +54,7 @@ config DUMP_CODE config DWARF_UNWINDER bool "Enable the DWARF unwinder for stacktraces" + depends on DEBUG_KERNEL select FRAME_POINTER default n help From patchwork Tue Oct 5 00:19:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12535147 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6D53C433EF for ; Tue, 5 Oct 2021 00:19:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B236D61247 for ; Tue, 5 Oct 2021 00:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbhJEAVG (ORCPT ); Mon, 4 Oct 2021 20:21:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbhJEAVG (ORCPT ); Mon, 4 Oct 2021 20:21:06 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADC54C061749; Mon, 4 Oct 2021 17:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=tBp2Xr2Aab9JmS/WKFkErf1SL00e2Cm2xg2oHgtaM9Y=; b=O+GylvMBR90V++DWbSrMt0eLBZ YCW8bJ6E5qrd4vuUI7UHebol10X6RGTPeXl3As76iVOuJaTVyZL8vBoT5Z+Xdav+HrIhphSewvFva YvQn1gOMdujRBvxZC+ZB/1W0OXweAblmowGOdhGfiTshL7g9djUH62ZW/zH6o2SLArzgP8GmjRocb i0hjM3oVngugdThoPDpNQ/5np0HZ5d75J6onDUY595ZV47n5SpZPpAptHY6bdmK66ikpM4t0UIKv3 SHqJhuFjMrgh2ShsTf7RgQAA3RFrGemwjAOkDRThzkuhnzCPkroE/RocHOrqhCkxZuPeJvCFJLRir UCF9+rkQ==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXYAu-008SGi-1t; Tue, 05 Oct 2021 00:19:16 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Geert Uytterhoeven Subject: [PATCH 2/5 v3] sh: add git tree to MAINTAINERS Date: Mon, 4 Oct 2021 17:19:11 -0700 Message-Id: <20211005001914.28574-3-rdunlap@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005001914.28574-1-rdunlap@infradead.org> References: <20211005001914.28574-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Add the git tree location for linux-sh. Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: John Paul Adrian Glaubitz Cc: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven --- v3: new patch in this series MAINTAINERS | 1 + 1 file changed, 1 insertion(+) --- linux-next-20211001.orig/MAINTAINERS +++ linux-next-20211001/MAINTAINERS @@ -18047,6 +18047,7 @@ M: Yoshinori Sato L: linux-sh@vger.kernel.org S: Maintained +T: git git://git.libc.org/linux-sh Q: http://patchwork.kernel.org/project/linux-sh/list/ F: Documentation/sh/ F: arch/sh/ From patchwork Tue Oct 5 00:19:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12535155 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E698AC433F5 for ; Tue, 5 Oct 2021 00:19:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2E1261247 for ; Tue, 5 Oct 2021 00:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230293AbhJEAVL (ORCPT ); Mon, 4 Oct 2021 20:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbhJEAVH (ORCPT ); Mon, 4 Oct 2021 20:21:07 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF00CC061745; Mon, 4 Oct 2021 17:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=EYFqAnmJiXkU9369rqhDh+53a9v29IG/nWtmm5Q/gvQ=; b=AT1k0439f8p6RELnkh79tTzSV1 1Yda1H4YkGk++E+A6YzpnF0NvVVj4wYnn8h8W060JsqSAC6DzBWu5+V5HLK9S6C8yqs/8tZCb6xbT HlTOgq0TayllThZ05pG9qOkMJAa/CEwW6KwCSL4Pd2ZMMoZOCYugC/BA9HqVjyF9MiFdp6TOZEMvz SwRAQaxyeDsYY0vFBVdNajDJQTKw6luvZsf1R5V4Ns6RCL7sXmr9xPn7k/aOgJ40MU1TdV4Nr9vwO Lj4W58ZT74J/0XeAziIdn9BSWkTIZceib3NRignsGKV0VEWww+bMJYjUK3by/b+H2QEVweQw5DUiC ZSe98IqQ==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXYAu-008SGi-Mw; Tue, 05 Oct 2021 00:19:16 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Geert Uytterhoeven , Takashi YOSHII Subject: [PATCH 3/5 v3] sh: math-emu: drop unused functions Date: Mon, 4 Oct 2021 17:19:12 -0700 Message-Id: <20211005001914.28574-4-rdunlap@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005001914.28574-1-rdunlap@infradead.org> References: <20211005001914.28574-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Delete ieee_fpe_handler() since it is not used. After that is done, delete denormal_to_double() since it is not used: ../arch/sh/math-emu/math.c:505:12: error: 'ieee_fpe_handler' defined but not used [-Werror=unused-function] 505 | static int ieee_fpe_handler(struct pt_regs *regs) ../arch/sh/math-emu/math.c:477:13: error: 'denormal_to_double' defined but not used [-Werror=unused-function] 477 | static void denormal_to_double(struct sh_fpu_soft_struct *fpu, int n) Fixes: 4b565680d163 ("sh: math-emu support") Signed-off-by: Randy Dunlap Cc: Takashi YOSHII Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: John Paul Adrian Glaubitz Cc: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven --- v3: new patch in this series; arch/sh/math-emu/math.c | 103 -------------------------------------- 1 file changed, 103 deletions(-) --- linux-next-20211001.orig/arch/sh/math-emu/math.c +++ linux-next-20211001/arch/sh/math-emu/math.c @@ -468,109 +468,6 @@ static int fpu_emulate(u16 code, struct } /** - * denormal_to_double - Given denormalized float number, - * store double float - * - * @fpu: Pointer to sh_fpu_soft structure - * @n: Index to FP register - */ -static void denormal_to_double(struct sh_fpu_soft_struct *fpu, int n) -{ - unsigned long du, dl; - unsigned long x = fpu->fpul; - int exp = 1023 - 126; - - if (x != 0 && (x & 0x7f800000) == 0) { - du = (x & 0x80000000); - while ((x & 0x00800000) == 0) { - x <<= 1; - exp--; - } - x &= 0x007fffff; - du |= (exp << 20) | (x >> 3); - dl = x << 29; - - fpu->fp_regs[n] = du; - fpu->fp_regs[n+1] = dl; - } -} - -/** - * ieee_fpe_handler - Handle denormalized number exception - * - * @regs: Pointer to register structure - * - * Returns 1 when it's handled (should not cause exception). - */ -static int ieee_fpe_handler(struct pt_regs *regs) -{ - unsigned short insn = *(unsigned short *)regs->pc; - unsigned short finsn; - unsigned long nextpc; - int nib[4] = { - (insn >> 12) & 0xf, - (insn >> 8) & 0xf, - (insn >> 4) & 0xf, - insn & 0xf}; - - if (nib[0] == 0xb || - (nib[0] == 0x4 && nib[2] == 0x0 && nib[3] == 0xb)) /* bsr & jsr */ - regs->pr = regs->pc + 4; - - if (nib[0] == 0xa || nib[0] == 0xb) { /* bra & bsr */ - nextpc = regs->pc + 4 + ((short) ((insn & 0xfff) << 4) >> 3); - finsn = *(unsigned short *) (regs->pc + 2); - } else if (nib[0] == 0x8 && nib[1] == 0xd) { /* bt/s */ - if (regs->sr & 1) - nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); - else - nextpc = regs->pc + 4; - finsn = *(unsigned short *) (regs->pc + 2); - } else if (nib[0] == 0x8 && nib[1] == 0xf) { /* bf/s */ - if (regs->sr & 1) - nextpc = regs->pc + 4; - else - nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); - finsn = *(unsigned short *) (regs->pc + 2); - } else if (nib[0] == 0x4 && nib[3] == 0xb && - (nib[2] == 0x0 || nib[2] == 0x2)) { /* jmp & jsr */ - nextpc = regs->regs[nib[1]]; - finsn = *(unsigned short *) (regs->pc + 2); - } else if (nib[0] == 0x0 && nib[3] == 0x3 && - (nib[2] == 0x0 || nib[2] == 0x2)) { /* braf & bsrf */ - nextpc = regs->pc + 4 + regs->regs[nib[1]]; - finsn = *(unsigned short *) (regs->pc + 2); - } else if (insn == 0x000b) { /* rts */ - nextpc = regs->pr; - finsn = *(unsigned short *) (regs->pc + 2); - } else { - nextpc = regs->pc + 2; - finsn = insn; - } - - if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */ - struct task_struct *tsk = current; - - if ((tsk->thread.xstate->softfpu.fpscr & (1 << 17))) { - /* FPU error */ - denormal_to_double (&tsk->thread.xstate->softfpu, - (finsn >> 8) & 0xf); - tsk->thread.xstate->softfpu.fpscr &= - ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); - task_thread_info(tsk)->status |= TS_USEDFPU; - } else { - force_sig_fault(SIGFPE, FPE_FLTINV, - (void __user *)regs->pc); - } - - regs->pc = nextpc; - return 1; - } - - return 0; -} - -/** * fpu_init - Initialize FPU registers * @fpu: Pointer to software emulated FPU registers. */ From patchwork Tue Oct 5 00:19:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12535149 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44088C433FE for ; Tue, 5 Oct 2021 00:19:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FC706137D for ; Tue, 5 Oct 2021 00:19:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbhJEAVH (ORCPT ); Mon, 4 Oct 2021 20:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbhJEAVH (ORCPT ); Mon, 4 Oct 2021 20:21:07 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83591C061749; Mon, 4 Oct 2021 17:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=UGnZuFAcpMUOmEXXyT7AcnFvYR5lLxeczg5QY3FKNLY=; b=xDuLagZaSCnZjjWpsOiriywC9q g+u74sCgC9CoPdFGVR0t42o4iAhCEdnEvihJKNkIu2EL9QrE1QTjl8AyvhD8AldymGBa1cJeSoR8N eLYSl+pNq9KgPCL6mVJ0tvZhvBbMuqfAdOciUzHwzIXOdcdmkaaytVKnP4qb02eI2dvzDSOGA0Utv 393asZkp1N9cxRMsDvvvzkxfdThCLTQfkiHX8LHJe+lLJpk8lxCT4ICvBNzNLj5Fz+XCfFeQYUxcY et+h6Y6rzbz1/KYQZVGnPAKi2dsJ7w/9MXWdTO02aOszs1qp81fhFZghpkwH3nhTz2sz0/VCZRWmm o3UlF5nQ==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXYAv-008SGi-35; Tue, 05 Oct 2021 00:19:17 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Geert Uytterhoeven Subject: [PATCH 4/5 v3] sh: define __BIG_ENDIAN for math-emu Date: Mon, 4 Oct 2021 17:19:13 -0700 Message-Id: <20211005001914.28574-5-rdunlap@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005001914.28574-1-rdunlap@infradead.org> References: <20211005001914.28574-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Fix this by defining both ENDIAN macros in so that they can be utilized in according to the latter's comment: /* Allow sfp-machine to have its own byte order definitions. */ (This is what is done in arch/nds32/include/asm/sfp-machine.h.) This placates these build warnings: In file included from ../arch/sh/math-emu/math.c:23: ../include/math-emu/single.h:50:21: warning: "__BIG_ENDIAN" is not defined, evaluates to 0 [-Wundef] 50 | #if __BYTE_ORDER == __BIG_ENDIAN In file included from ../arch/sh/math-emu/math.c:24: ../include/math-emu/double.h:59:21: warning: "__BIG_ENDIAN" is not defined, evaluates to 0 [-Wundef] 59 | #if __BYTE_ORDER == __BIG_ENDIAN Fixes: 4b565680d163 ("sh: math-emu support") Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: John Paul Adrian Glaubitz Reviewed-by: Geert Uytterhoeven Tested-by: John Paul Adrian Glaubitz --- v2: use same preprocessor method that nds32 does; add Geert's Reviewed-by; renumber patches; add more Cc's; v3: renumber, rebase, and resend; add Tested-by: JPAG; arch/sh/include/asm/sfp-machine.h | 8 ++++++++ 1 file changed, 8 insertions(+) --- linux-next-20211001.orig/arch/sh/include/asm/sfp-machine.h +++ linux-next-20211001/arch/sh/include/asm/sfp-machine.h @@ -13,6 +13,14 @@ #ifndef _SFP_MACHINE_H #define _SFP_MACHINE_H +#ifdef __BIG_ENDIAN__ +#define __BYTE_ORDER __BIG_ENDIAN +#define __LITTLE_ENDIAN 0 +#else +#define __BYTE_ORDER __LITTLE_ENDIAN +#define __BIG_ENDIAN 0 +#endif + #define _FP_W_TYPE_SIZE 32 #define _FP_W_TYPE unsigned long #define _FP_WS_TYPE signed long From patchwork Tue Oct 5 00:19:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12535153 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4038C433EF for ; Tue, 5 Oct 2021 00:19:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8833461247 for ; Tue, 5 Oct 2021 00:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230254AbhJEAVJ (ORCPT ); Mon, 4 Oct 2021 20:21:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbhJEAVH (ORCPT ); Mon, 4 Oct 2021 20:21:07 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF05CC061749; Mon, 4 Oct 2021 17:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=M0GxxOUNM2NCgc5+UlE92aSv5qcyndOY+ydhMBjsJuA=; b=M+samDPbBs8WEBQlqyC8UWsnso INCEEuWpzxdztDVkEkDFALllDIhLEKOPKjtTuukoxlVvHLGoFybt7rNachompFDKZml05SSXoak5r FbhV85DZu4RtQOBuBPEYun553dRabsESNB/rmeKuay40gpvCclDfl6wsii8lIRNDgm6S+kukWAXl6 yAXqLn//QbBzuuXYSdO98dEhs8MCFMojhIoKi4iSV3YyeIw0vt5upSiu7dajuyC6S5WZiWB+tmwb9 wUlrNSJfDYQrZoklRhhcAEEbiiQBgyWUcopSsUVMAE36hB4/42HeLtF3tigAD9LCZdI6EfJG3E78E tI3oyb/A==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXYAv-008SGi-GY; Tue, 05 Oct 2021 00:19:17 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Geert Uytterhoeven , Takashi YOSHII Subject: [PATCH 5/5 v3] sh: fix READ/WRITE redefinition warnings Date: Mon, 4 Oct 2021 17:19:14 -0700 Message-Id: <20211005001914.28574-6-rdunlap@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211005001914.28574-1-rdunlap@infradead.org> References: <20211005001914.28574-1-rdunlap@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org kernel.h defines READ and WRITE, so rename the SH math-emu macros to MREAD and MWRITE. Fixes these warnings: ../arch/sh/math-emu/math.c:54: warning: "WRITE" redefined 54 | #define WRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;}) In file included from ../arch/sh/math-emu/math.c:10: ../include/linux/kernel.h:37: note: this is the location of the previous definition 37 | #define WRITE 1 ../arch/sh/math-emu/math.c:55: warning: "READ" redefined 55 | #define READ(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;}) In file included from ../arch/sh/math-emu/math.c:10: ../include/linux/kernel.h:36: note: this is the location of the previous definition 36 | #define READ 0 Fixes: 4b565680d163 ("sh: math-emu support") Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: Takashi YOSHII Cc: John Paul Adrian Glaubitz Cc: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven --- v2: renumber patches, otherwise no change; v3: renumber, rebase, & resend; add Rev-by: Geert; arch/sh/math-emu/math.c | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) --- linux-next-20211001.orig/arch/sh/math-emu/math.c +++ linux-next-20211001/arch/sh/math-emu/math.c @@ -51,8 +51,8 @@ #define Rn (regs->regs[n]) #define Rm (regs->regs[m]) -#define WRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;}) -#define READ(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;}) +#define MWRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;}) +#define MREAD(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;}) #define PACK_S(r,f) FP_PACK_SP(&r,f) #define UNPACK_S(f,r) FP_UNPACK_SP(f,&r) @@ -157,11 +157,11 @@ fmov_idx_reg(struct sh_fpu_soft_struct * { if (FPSCR_SZ) { FMOV_EXT(n); - READ(FRn, Rm + R0 + 4); + MREAD(FRn, Rm + R0 + 4); n++; - READ(FRn, Rm + R0); + MREAD(FRn, Rm + R0); } else { - READ(FRn, Rm + R0); + MREAD(FRn, Rm + R0); } return 0; @@ -173,11 +173,11 @@ fmov_mem_reg(struct sh_fpu_soft_struct * { if (FPSCR_SZ) { FMOV_EXT(n); - READ(FRn, Rm + 4); + MREAD(FRn, Rm + 4); n++; - READ(FRn, Rm); + MREAD(FRn, Rm); } else { - READ(FRn, Rm); + MREAD(FRn, Rm); } return 0; @@ -189,12 +189,12 @@ fmov_inc_reg(struct sh_fpu_soft_struct * { if (FPSCR_SZ) { FMOV_EXT(n); - READ(FRn, Rm + 4); + MREAD(FRn, Rm + 4); n++; - READ(FRn, Rm); + MREAD(FRn, Rm); Rm += 8; } else { - READ(FRn, Rm); + MREAD(FRn, Rm); Rm += 4; } @@ -207,11 +207,11 @@ fmov_reg_idx(struct sh_fpu_soft_struct * { if (FPSCR_SZ) { FMOV_EXT(m); - WRITE(FRm, Rn + R0 + 4); + MWRITE(FRm, Rn + R0 + 4); m++; - WRITE(FRm, Rn + R0); + MWRITE(FRm, Rn + R0); } else { - WRITE(FRm, Rn + R0); + MWRITE(FRm, Rn + R0); } return 0; @@ -223,11 +223,11 @@ fmov_reg_mem(struct sh_fpu_soft_struct * { if (FPSCR_SZ) { FMOV_EXT(m); - WRITE(FRm, Rn + 4); + MWRITE(FRm, Rn + 4); m++; - WRITE(FRm, Rn); + MWRITE(FRm, Rn); } else { - WRITE(FRm, Rn); + MWRITE(FRm, Rn); } return 0; @@ -240,12 +240,12 @@ fmov_reg_dec(struct sh_fpu_soft_struct * if (FPSCR_SZ) { FMOV_EXT(m); Rn -= 8; - WRITE(FRm, Rn + 4); + MWRITE(FRm, Rn + 4); m++; - WRITE(FRm, Rn); + MWRITE(FRm, Rn); } else { Rn -= 4; - WRITE(FRm, Rn); + MWRITE(FRm, Rn); } return 0; @@ -445,11 +445,11 @@ id_sys(struct sh_fpu_soft_struct *fregs, case 0x4052: case 0x4062: Rn -= 4; - WRITE(*reg, Rn); + MWRITE(*reg, Rn); break; case 0x4056: case 0x4066: - READ(*reg, Rn); + MREAD(*reg, Rn); Rn += 4; break; default: