From nobody Thu Apr 9 12:06:27 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 45EBE38947E for ; Mon, 2 Mar 2026 09:28:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772443718; cv=none; b=LJ3k8wlIjgik6T2XRJQd0qBpsu96xUvTK8wB4BZPjx2+SU5jMc8XgjCpTxV3ayfteu7jng5BEgdtqXHxMPFBvZMseNcwJWf5r90hvpK0v7Bou+UUvb+MWHdBp4mmP2mSbffvvpb8onht4OYGVjDGGA7OITycyuu9kBuquU09Ii8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772443718; c=relaxed/simple; bh=l8g0HJB+zfoz013VSJXB9KTrrvyoI/0vm2ePCkgZOg0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LFm/e30dGssM63SlcUedyFOOZfoyqlVNshduyPsIiuaEI/UI1iaHZ0pZkeCDhQGbGFjN4r1oAfrYZDOGoQPXMgz6NhtOtFZg6E84wtOJHAsD+uk5ZHCmk9/Iygx5b4vUTOTHP1KeN93AHkNo7yyHgOI1yL/WCCnaSRNGhh8QI1Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HAJk2DFU; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HAJk2DFU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772443717; x=1803979717; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l8g0HJB+zfoz013VSJXB9KTrrvyoI/0vm2ePCkgZOg0=; b=HAJk2DFUllZ4tnFfAF2XXs30y74LacFhAIHDyvsnHOnst+glcqckHm0W 9rByBzJqC1P1u9MDQ1JO+FyVQSf5EFi6FyzvNmUS8BIt9YnJgKM0V+zNw 2ufwEZrMcA5eqDca+yi9YMR4j2lZB0UtE0JUzh0IvhmeFU2gsy3M5L3eE c2OpKilx15sFkRMJXAmV8OXQI0Z80ipVYjc4Vqc0iRrRoteKOOdlFDrpQ 3WyIQAJpRmJq5TNQgeig0QTDDM2SATe4uiGTyp9MpmYFqrv59f48qxZIz GqTaRj06LLq1EKHFfidQryEI4vSHpHSREYuTiutFlbrZUVsyHFMCWftkl w==; X-CSE-ConnectionGUID: 6+q7hFuJSMilftRkCFjreQ== X-CSE-MsgGUID: u+f2rbNyQCekLZJzON7j5w== X-IronPort-AV: E=McAfee;i="6800,10657,11716"; a="73557666" X-IronPort-AV: E=Sophos;i="6.21,319,1763452800"; d="scan'208";a="73557666" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2026 01:28:35 -0800 X-CSE-ConnectionGUID: ODy/UByFSP6oGhnr0RptLw== X-CSE-MsgGUID: sOTNBQHbRXKaz0DNa+aG5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,319,1763452800"; d="scan'208";a="248099562" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa002.jf.intel.com with ESMTP; 02 Mar 2026 01:28:35 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 41DA398; Mon, 02 Mar 2026 10:28:33 +0100 (CET) From: Andy Shevchenko To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Randy Dunlap , Andy Shevchenko , Kuan-Wei Chiu Subject: [PATCH v2 1/3] lib: polynomial: Move to math/ subfolder Date: Mon, 2 Mar 2026 10:28:07 +0100 Message-ID: <20260302092831.2267785-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260302092831.2267785-1-andriy.shevchenko@linux.intel.com> References: <20260302092831.2267785-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The algorithm behind polynomial belongs to our collection of math equations and expressions handling. Move it to math/ subfolder where others of the kind are located. Reviewed-by: Kuan-Wei Chiu Signed-off-by: Andy Shevchenko --- lib/Kconfig | 3 --- lib/Makefile | 2 -- lib/math/Kconfig | 3 +++ lib/math/Makefile | 1 + lib/{ =3D> math}/polynomial.c | 0 5 files changed, 4 insertions(+), 5 deletions(-) rename lib/{ =3D> math}/polynomial.c (100%) diff --git a/lib/Kconfig b/lib/Kconfig index 5be57adcd454..00a9509636c1 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -626,9 +626,6 @@ config PLDMFW config ASN1_ENCODER tristate =20 -config POLYNOMIAL - tristate - config FIRMWARE_TABLE bool =20 diff --git a/lib/Makefile b/lib/Makefile index 84da412a044f..9ea149e618d2 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -243,8 +243,6 @@ obj-$(CONFIG_MEMREGION) +=3D memregion.o obj-$(CONFIG_STMP_DEVICE) +=3D stmp_device.o obj-$(CONFIG_IRQ_POLL) +=3D irq_poll.o =20 -obj-$(CONFIG_POLYNOMIAL) +=3D polynomial.o - # stackdepot.c should not be instrumented or call instrumented functions. # Prevent the compiler from calling builtins like memcmp() or bcmp() from = this # file. diff --git a/lib/math/Kconfig b/lib/math/Kconfig index 0634b428d0cb..0e6d9cffc5d6 100644 --- a/lib/math/Kconfig +++ b/lib/math/Kconfig @@ -5,6 +5,9 @@ config CORDIC This option provides an implementation of the CORDIC algorithm; calculations are in fixed point. Module will be called cordic. =20 +config POLYNOMIAL + tristate + config PRIME_NUMBERS tristate "Simple prime number generator for testing" help diff --git a/lib/math/Makefile b/lib/math/Makefile index d1caba23baa0..9a3850d55b79 100644 --- a/lib/math/Makefile +++ b/lib/math/Makefile @@ -2,6 +2,7 @@ obj-y +=3D div64.o gcd.o lcm.o int_log.o int_pow.o int_sqrt.o reciprocal_d= iv.o =20 obj-$(CONFIG_CORDIC) +=3D cordic.o +obj-$(CONFIG_POLYNOMIAL) +=3D polynomial.o obj-$(CONFIG_PRIME_NUMBERS) +=3D prime_numbers.o obj-$(CONFIG_RATIONAL) +=3D rational.o =20 diff --git a/lib/polynomial.c b/lib/math/polynomial.c similarity index 100% rename from lib/polynomial.c rename to lib/math/polynomial.c --=20 2.50.1 From nobody Thu Apr 9 12:06:27 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 815F938F624 for ; Mon, 2 Mar 2026 09:28:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772443719; cv=none; b=mNURZv7nbW+6Qgb8rnsFbBoAVjT0oeUGZ+ZmMuimxLXV/ikqPlhwLVyIE0zWOKgf6GQv6o38fqkABBGbFC4dKC6boKM1CtYnmwO3ztsLtnpR1r9Kx731gtRevVBrW6TeLV0tlrUqOgvJAZx2U5l5jz6j+v+lAkkiG7RRGspDeQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772443719; c=relaxed/simple; bh=9mW7MukWOTwZKcoUAM5c21nkSuG87k/JRGTfPdNBX9s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NkmqPQfPuXQtiMYvAigjwtTxzB/oExCSi7RbkswiRjC9RJRX5qLzHpLdPsHgKI2ivF1plOxKBSJy6gXNygSUsl35exuyQVqgF4A/LO10heI6tx3PCZUGK8tFH3AIihKLcABXM/qJRETUpVEn57+wT99fSKUJekcmR6BCWqe/2I8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Hfe4/733; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Hfe4/733" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772443718; x=1803979718; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9mW7MukWOTwZKcoUAM5c21nkSuG87k/JRGTfPdNBX9s=; b=Hfe4/733YwZS8+lSAR1Fp0Jh+G8PKxX/jOTovVfokZSITKLwF7eWJKTB rSkGkSUKJ69iiF6ZpDf/tNnYrmujaZ28g5pQqVJgRyHmK0s7evAWEstyG cfh8WLLWUgeMjjlQA8/O30+mZhgxpxY6YUyW8saDO5YzLmGGG/9Y2b19K a7dK+2frSSKfkSzuRB4UC3/aG6RrG5HEu9VTLrP2ieWb4NeyF/aMWSv1E vnXMNdil8XIQTMFvQrjGYm1kNw+yaReIj5CUWpeG2kQmx/CmTsOq2aadI YLioyVXsCUPj82oChRJmqgqy8DBxUGrGqyx2gR8p3kF20ADXdgPH9Prxv Q==; X-CSE-ConnectionGUID: gn9il/+3Sr6hdmI0cTeSpw== X-CSE-MsgGUID: E3qYWJ3VTSaZCD58E8Q6Lg== X-IronPort-AV: E=McAfee;i="6800,10657,11716"; a="73557674" X-IronPort-AV: E=Sophos;i="6.21,319,1763452800"; d="scan'208";a="73557674" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2026 01:28:36 -0800 X-CSE-ConnectionGUID: 4JbKAv16RmGsic5xe5H3QQ== X-CSE-MsgGUID: 3FiP9KXaSOudIfO6V3i3jg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,319,1763452800"; d="scan'208";a="221749324" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa003.jf.intel.com with ESMTP; 02 Mar 2026 01:28:35 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 4611C99; Mon, 02 Mar 2026 10:28:33 +0100 (CET) From: Andy Shevchenko To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Randy Dunlap , Andy Shevchenko , Kuan-Wei Chiu Subject: [PATCH v2 2/3] lib: math: polynomial: Don't use 'proxy' headers Date: Mon, 2 Mar 2026 10:28:08 +0100 Message-ID: <20260302092831.2267785-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260302092831.2267785-1-andriy.shevchenko@linux.intel.com> References: <20260302092831.2267785-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Update header inclusions to follow IWYU (Include What You Use) principle. Reviewed-by: Kuan-Wei Chiu Signed-off-by: Andy Shevchenko --- lib/math/polynomial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/math/polynomial.c b/lib/math/polynomial.c index 66d383445fec..8c622099ef81 100644 --- a/lib/math/polynomial.c +++ b/lib/math/polynomial.c @@ -10,7 +10,8 @@ * */ =20 -#include +#include +#include #include #include =20 --=20 2.50.1 From nobody Thu Apr 9 12:06:27 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 96AF238E106 for ; Mon, 2 Mar 2026 09:28:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772443718; cv=none; b=oOVBMjXeCm2tfB2CA5FZTd55PIIMxZq86xmLlOQpwAZiCOa5guDHkBYW12p9TBHOEfETs1zPS8118qbQJazKgTIWbH4ycOBbM4OmC1ZrrhivJmXCQ3dXuTjP5UvW8ZEvFqxgUD55ac4ToVqJyqF1c2sduuluDFx98/f2hmUy9q0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772443718; c=relaxed/simple; bh=c6yLg20Vn0hQTixbTzJI+7Ub5QdPumf9XL7DzfXqK5M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=exx4sMjv+6WJU5X4GOsYKqbHhi4PvZeH7POWOqZrofOoF5+HjozeF1f7TEUoLWIbr2EDZSruTX2UyaGe8SVytdENu8jIfRPNu3jo7JC2zljiSg+kwGmyBp3PmLy3uMg/j58cgcnMbZrVHh3CCzswaakyQvucevYEmQHWr3crMhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YhRinJMI; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YhRinJMI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772443717; x=1803979717; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c6yLg20Vn0hQTixbTzJI+7Ub5QdPumf9XL7DzfXqK5M=; b=YhRinJMIBIWGjJqeQ+RmHhlkxGnTWocrVD7cpTlar4uT3NfN+w1H2NAR 9jIWZPrqwttyxi0VX8VDQqDA8oyYl0cmnCahdrlfOerOjmmr7s5Wc8+zf eCp29dSgUWq0+19BQ2DU2bkpCFRYEaRg7BvwRi7+vvf3jqDsS36SmNVeg rgfC56KKQHunEAebdlXNl1r1CphQXBlj1REZWVFqm7f8av/S/22W+2cYu vpGGbgmYfBc+A2jw4GnXhVL7qNZLpTe3F/4gfY+0i0Y6EI9Wmmd3YZt0l YiigBXnQew5ZpNbLLvMflFgAFD14dgnKwW1ZnxgZq2Z4l8dLZ8im9Yl7o g==; X-CSE-ConnectionGUID: yis+muUFRGeXjzxKLJ5RMQ== X-CSE-MsgGUID: qdoowY4QSm2TuDG5jDFgpw== X-IronPort-AV: E=McAfee;i="6800,10657,11716"; a="73557671" X-IronPort-AV: E=Sophos;i="6.21,319,1763452800"; d="scan'208";a="73557671" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2026 01:28:36 -0800 X-CSE-ConnectionGUID: D3QYv/heRPKuFmpN/hnMUw== X-CSE-MsgGUID: rvAHJ1paQiGM47Tlz8yGTA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,319,1763452800"; d="scan'208";a="248099560" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa002.jf.intel.com with ESMTP; 02 Mar 2026 01:28:35 -0800 Received: by black.igk.intel.com (Postfix, from userid 1003) id 4AE9B9B; Mon, 02 Mar 2026 10:28:33 +0100 (CET) From: Andy Shevchenko To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Randy Dunlap , Andy Shevchenko , Kuan-Wei Chiu Subject: [PATCH v2 3/3] lib: math: polynomial: Remove link to non-exist file and fix spelling Date: Mon, 2 Mar 2026 10:28:09 +0100 Message-ID: <20260302092831.2267785-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260302092831.2267785-1-andriy.shevchenko@linux.intel.com> References: <20260302092831.2267785-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Baikal SoC and platform support was dropped from the kernel, remove the reference to non-exist file. While at it, fix spelling. Reviewed-by: Randy Dunlap Reviewed-by: Kuan-Wei Chiu Signed-off-by: Andy Shevchenko --- lib/math/polynomial.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/math/polynomial.c b/lib/math/polynomial.c index 8c622099ef81..f26677cfeeff 100644 --- a/lib/math/polynomial.c +++ b/lib/math/polynomial.c @@ -16,16 +16,13 @@ #include =20 /* - * Originally this was part of drivers/hwmon/bt1-pvt.c. - * There the following conversion is used and should serve as an example h= ere: + * The following conversion is an example: * * The original translation formulae of the temperature (in degrees of Cel= sius) * to PVT data and vice-versa are following: * - * N =3D 1.8322e-8*(T^4) + 2.343e-5*(T^3) + 8.7018e-3*(T^2) + 3.9269*(T^1)= + - * 1.7204e2 - * T =3D -1.6743e-11*(N^4) + 8.1542e-8*(N^3) + -1.8201e-4*(N^2) + - * 3.1020e-1*(N^1) - 4.838e1 + * N =3D 1.8322e-8*(T^4) + 2.343e-5*(T^3) + 8.7018e-3*(T^2) + 3.9269*(T^1)= + 1.7204e2 + * T =3D -1.6743e-11*(N^4) + 8.1542e-8*(N^3) + -1.8201e-4*(N^2) + 3.1020e-= 1*(N^1) - 4.838e1 * * where T =3D [-48.380, 147.438]C and N =3D [0, 1023]. * @@ -36,10 +33,9 @@ * formulae to accept millidegrees of Celsius. Here what they look like af= ter * the alterations: * - * N =3D (18322e-20*(T^4) + 2343e-13*(T^3) + 87018e-9*(T^2) + 39269e-3*T + - * 17204e2) / 1e4 - * T =3D -16743e-12*(D^4) + 81542e-9*(D^3) - 182010e-6*(D^2) + 310200e-3*D= - - * 48380 + * N =3D (18322e-20*(T^4) + 2343e-13*(T^3) + 87018e-9*(T^2) + 39269e-3*T += 17204e2) / 1e4 + * T =3D -16743e-12*(D^4) + 81542e-9*(D^3) - 182010e-6*(D^2) + 310200e-3*D= - 48380 + * * where T =3D [-48380, 147438] mC and N =3D [0, 1023]. * * static const struct polynomial poly_temp_to_N =3D { @@ -69,13 +65,13 @@ * polynomial_calc - calculate a polynomial using integer arithmetic * * @poly: pointer to the descriptor of the polynomial - * @data: input value of the polynimal + * @data: input value of the polynomial * * Calculate the result of a polynomial using only integer arithmetic. For * this to work without too much loss of precision the coefficients has to * be altered. This is called factor redistribution. * - * Returns the result of the polynomial calculation. + * Return: the result of the polynomial calculation. */ long polynomial_calc(const struct polynomial *poly, long data) { --=20 2.50.1