Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4093724pxb; Mon, 4 Oct 2021 17:22:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfRJ8KPCE4IM/l1AYh9a+c0SuLFAazby5dc7QJ+9BY3xUeMrMQEjZJko2xM5H2NxcJ619r X-Received: by 2002:a50:9dc4:: with SMTP id l4mr21774730edk.208.1633393328983; Mon, 04 Oct 2021 17:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633393328; cv=none; d=google.com; s=arc-20160816; b=hIn0ayuwEXo7WrGt0u8LJ6mCK4ZJIM5kNkwZ1BudonTGDTD5a9pdPZfwQvl6JERScX KHRaunvn7H57fIXu1Z8zEJHX4TSgGBQSdcW42bbLeIrYNRohI7tq+8unx7vrcfGVcCrp 6FQpx/09D2BYi2ceygRHcGKO4uSsrSTsabV0Ou86ahf/9oqn9BXESqOUjYd4cdfWsyqe BsOgO6SlcDb66qtPSuopHKQG3LLk6mRASobs0NnSGvX9Khei/nY61HPX1E7o6R/y60An Q0SRgZDlwFatXeS0V8H2YEjYC7ogZ2aPnOgNa/AMBYQaXml+w1d0EeZ5KZYDgRSRxL2k dSRg== 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 :dkim-signature; bh=EYFqAnmJiXkU9369rqhDh+53a9v29IG/nWtmm5Q/gvQ=; b=VQZDXzxgnbQST+t3EG8zYNC+J3KL2D+g9zHInBESnZ/2dypywZ+XYq/3uuUnFQfS/6 +LIcHOQ3L63CFMrTxz72uepVnrePI0NGXmg0TADv4LAwOwmx7xvE6zEKErrCdLa4oPYU GthYDDj89/BoRNy44WMRJoyFXYOxzjJPCT6EI1iGY0drKC/KBu2LMO2lfAc5M+VRCNVM zwknlMKv+O1oB5vlRxU9pE05iAX8kfhN5Wsd8WqXJ+4W71KEnuyyl5+NQtLYEUsrM4gL RDgU5YLsKHZgJmbv4fcyzHFBq0bdf6YLbOiHDl5tCMToy3eGz8z6Ric+VKYqzngZ5ctJ KVBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=AT1k0439; 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 m12si21813945edd.470.2021.10.04.17.21.45; Mon, 04 Oct 2021 17:22:08 -0700 (PDT) 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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=AT1k0439; 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 S230448AbhJEAVS (ORCPT + 99 others); Mon, 4 Oct 2021 20:21:18 -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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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. */