Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1374635lqe; Mon, 8 Apr 2024 07:17:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgHCoTdFJS/j6upe5D5YVsG9Y2xTg/k5ah4PrgtOjKWM8rYNdklaCZeIUj1pVr7KmYkV4lDZM8mR9lkjfYB46kQAfHTS6aSBliJMcM6w== X-Google-Smtp-Source: AGHT+IHEaNPhHJ2sm1vEoaWq2FiEwXyFmp2IgKPeOYZevR8Q6+NVqp2vKwQiKhu+qAdwzX1+mMG0 X-Received: by 2002:a50:d653:0:b0:56e:2d93:3f7f with SMTP id c19-20020a50d653000000b0056e2d933f7fmr8678677edj.39.1712585835068; Mon, 08 Apr 2024 07:17:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712585835; cv=pass; d=google.com; s=arc-20160816; b=Kqb6FWlVarvbCz800L4WIHij8auMhxSJWcVWSpUCalmoJOEyuUOto1h9+l0+f7a6TO fY0RXBqEjUHkS95Dv2vgT9npl4+tYbh2pAKM0r/HKWwXcdKCIw5C67fxhm8ZaJ/x6C8P CD5et7e7WDGBIJfYNw9zh9lVwjYBNpuc4npq1c2mpUcJ+5GM/Q4BY5DxdskIWeGKdUcy RlSqVy/ttLZ8YjiDaf9BLHilNiCF9j/13yQWYJPQqv/pAnCloTQkAA+a5osv00tYtbEW BFKVnJbd0KPKfrQGMh9maOoQIfvBqaqGUaTHkE/FPk/w/DIgsADaf4VMqxc5yXLDvGp/ xH3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=+MlJ5XHbN1NPPl7eX/WyHg2J+EFd1iqsdaFiPEliwt8=; fh=F/7ToMqWphjUpPQcjjvU1m782hIZjL8JW1jDDRDSxqs=; b=VbcvacSEL0FAdLTmTosagRRF631+N0u53sxGyfzJr+8q8L53NCgPM2SbGJ7AOu3wfR MC/Sp7sO07YcKH6xE1vp5lzEqAHuPUOK84X6mmNLWCes8b4K5VWdEFmlRHyAyM/pCC5/ pBgEwpqMzSLYLETPFGVLAWBehMLN8kCralGbCoPZcCniesuExrY1W9FCv6/qUO06cBkw HpcGygQ5KXvB4ezTSveDEIZdL71+c7fzBbhAyYCELRdoGUJzPyPv75EOWJJmOg3GXkHD YGhWjHEpPTJxMQeUb0PtYFRL+PBAq6n1iO8Jz4H2dFT3DLDuUAEQy+usPspPKyFEzGl1 b3jA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="3QDJlZ/n"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-135495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s27-20020a50d49b000000b0056e2f95e09dsi3662383edi.612.2024.04.08.07.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 07:17:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="3QDJlZ/n"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-135495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9E3A71F222C5 for ; Mon, 8 Apr 2024 14:17:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9022086240; Mon, 8 Apr 2024 14:16:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3QDJlZ/n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="enPTaBQf" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C951D85C6F; Mon, 8 Apr 2024 14:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712585806; cv=none; b=AyZBBH3mk5XqD6hxJ/4jWUV+WpBueRoJ+xR2fI/Y9jseMTmTQmoQy50V5ekgBqgfsSiiXLJwem229sBNXvTooYFAQCzhx8vi7YB/GWjvIXpEGTHnbxbO825CWtAMhMLBfpKZ2SWKmkdx/9y/TRYpd5eeq3sbSv8ZFgmAzWCTHK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712585806; c=relaxed/simple; bh=bh8nWSuXPbDtnBugyVIiuU1sUkbw3RyB5fyuPJeGgvA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=PslPokGPHqY2XGPhw3ktAHRQRiY2mgPEzFPLr56h7ZvfqfBWMlhef3556smDuS53O79dPdanmDJuzT8TM3t8BlcIuYOCcgSTgiJG+PTvmYrdoVADN+gx2SAFvQNjZAXc2qnZcGaIxVVb/16r8GNHkXXQxY24TlFji+N7BP0SvoA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3QDJlZ/n; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=enPTaBQf; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Mon, 08 Apr 2024 14:16:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712585802; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+MlJ5XHbN1NPPl7eX/WyHg2J+EFd1iqsdaFiPEliwt8=; b=3QDJlZ/nu3I3QxaFTacN+LZXoUyV7TUDMa4E7DEKxKCc2oBxrfmpoG51Vvt31wHQ7dsZw6 neGdlzsxSEfdJDIEFdECvfYrcybpMSq5i9UWQH82Bfu6iLr6faYRtsarl94LMZTJBOVgYv 6LoXtaZ1eNf6sIylkog/BzYj5lrerVeScSrKC8U+BhVh4acASTK95SgK0u799e4HQIvja5 zN/byFh9RuwaHe4ujTWBl+B8xwPcw3YapwOQzvny9Z9AgtLFYKzta15XLcWEVBcBMX2tRT ooHsMhlOJwUzFlyfx3dhrDAm7fwTp3ivNCCLT933GtPWPB40taGsxBZ1nVGw+A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712585802; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+MlJ5XHbN1NPPl7eX/WyHg2J+EFd1iqsdaFiPEliwt8=; b=enPTaBQf12ezEGVDgbh18i7JayXf6RHCU8JxnLcYSfJ099dAciZVc2iNyC2NCavwI1EQEy rIqOBM3b0zggu6BA== From: "tip-bot2 for Arnd Bergmann" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/math-emu: Fix function cast warnings Cc: Arnd Bergmann , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240213095631.454543-1-arnd@kernel.org> References: <20240213095631.454543-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171258580133.10875.15729476936056309317.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: e0ca9353a86c0459a9c3fc8d65f7c88e96217cea Gitweb: https://git.kernel.org/tip/e0ca9353a86c0459a9c3fc8d65f7c88e96217cea Author: Arnd Bergmann AuthorDate: Thu, 04 Apr 2024 18:17:24 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 08 Apr 2024 16:06:22 +02:00 x86/math-emu: Fix function cast warnings clang-16 warns about casting function pointers with incompatible prototypes. The x86 math-emu code does this in a number of places to call some trivial functions that need no arguments: arch/x86/math-emu/fpu_etc.c:124:14: error: cast from 'void (*)(void)' to 'FUNC_ST0' \ (aka 'void (*)(struct fpu__reg *, unsigned char)') converts to incompatible function \ type [-Werror,-Wcast-function-type-strict] 124 | fchs, fabs, (FUNC_ST0) FPU_illegal, (FUNC_ST0) FPU_illegal, | ^~~~~~~~~~~~~~~~~~~~~~ arch/x86/math-emu/fpu_trig.c:1634:19: error: cast from 'void (*)(void)' to 'FUNC_ST0' \ (aka 'void (*)(struct fpu__reg *, unsigned char)') converts to incompatible function \ type [-Werror,-Wcast-function-type-strict] 1634 | fxtract, fprem1, (FUNC_ST0) fdecstp, (FUNC_ST0) fincstp | ^~~~~~~~~~~~~~~~~~ arch/x86/math-emu/reg_constant.c:112:53: error: cast from 'void (*)(void)' to 'FUNC_RC' \ (aka 'void (*)(int)') converts to incompatible function \ type [-Werror,-Wcast-function-type-strict] 112 | fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, (FUNC_RC) FPU_illegal Change the fdecstp() and fincstp() functions to actually have the correct prototypes based on the caller, and add wrappers around FPU_illegal() for adapting those. Signed-off-by: Arnd Bergmann Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/lkml/20240213095631.454543-1-arnd@kernel.org --- arch/x86/math-emu/fpu_etc.c | 9 +++++++-- arch/x86/math-emu/fpu_trig.c | 6 +++--- arch/x86/math-emu/reg_constant.c | 7 ++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/x86/math-emu/fpu_etc.c b/arch/x86/math-emu/fpu_etc.c index 1b118fd..39423ec 100644 --- a/arch/x86/math-emu/fpu_etc.c +++ b/arch/x86/math-emu/fpu_etc.c @@ -120,9 +120,14 @@ static void fxam(FPU_REG *st0_ptr, u_char st0tag) setcc(c); } +static void FPU_ST0_illegal(FPU_REG *st0_ptr, u_char st0_tag) +{ + FPU_illegal(); +} + static FUNC_ST0 const fp_etc_table[] = { - fchs, fabs, (FUNC_ST0) FPU_illegal, (FUNC_ST0) FPU_illegal, - ftst_, fxam, (FUNC_ST0) FPU_illegal, (FUNC_ST0) FPU_illegal + fchs, fabs, FPU_ST0_illegal, FPU_ST0_illegal, + ftst_, fxam, FPU_ST0_illegal, FPU_ST0_illegal, }; void FPU_etc(void) diff --git a/arch/x86/math-emu/fpu_trig.c b/arch/x86/math-emu/fpu_trig.c index 990d847..85daf98 100644 --- a/arch/x86/math-emu/fpu_trig.c +++ b/arch/x86/math-emu/fpu_trig.c @@ -433,13 +433,13 @@ static void fxtract(FPU_REG *st0_ptr, u_char st0_tag) #endif /* PARANOID */ } -static void fdecstp(void) +static void fdecstp(FPU_REG *st0_ptr, u_char st0_tag) { clear_C1(); top--; } -static void fincstp(void) +static void fincstp(FPU_REG *st0_ptr, u_char st0_tag) { clear_C1(); top++; @@ -1631,7 +1631,7 @@ static void fscale(FPU_REG *st0_ptr, u_char st0_tag) static FUNC_ST0 const trig_table_a[] = { f2xm1, fyl2x, fptan, fpatan, - fxtract, fprem1, (FUNC_ST0) fdecstp, (FUNC_ST0) fincstp + fxtract, fprem1, fdecstp, fincstp, }; void FPU_triga(void) diff --git a/arch/x86/math-emu/reg_constant.c b/arch/x86/math-emu/reg_constant.c index 742619e..003a0b2 100644 --- a/arch/x86/math-emu/reg_constant.c +++ b/arch/x86/math-emu/reg_constant.c @@ -108,8 +108,13 @@ static void fldz(int rc) typedef void (*FUNC_RC) (int); +static void FPU_RC_illegal(int unused) +{ + FPU_illegal(); +} + static FUNC_RC constants_table[] = { - fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, (FUNC_RC) FPU_illegal + fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, FPU_RC_illegal }; void fconst(void)