linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: clean up warnings found by checkpatch
@ 2022-05-29 15:06 XueBing Chen
  0 siblings, 0 replies; only message in thread
From: XueBing Chen @ 2022-05-29 15:06 UTC (permalink / raw)
  To: billm, tglx, mingo, bp, dave.hansen, x86; +Cc: hpa, linux-kernel


Clean up a handful of checkpatch warnings:
- WARNING: Prefer 'long' over 'long int' as the int is unnecessary
- ERROR: "foo * bar" should be "foo *bar"
- WARNING: Unnecessary typecast of c90 int constant
- '(unsigned int)0xb504f334' could be '0xb504f334U'
- WARNING: Unnecessary typecast of c90 int constant
- '(unsigned int)0xafb0ccc0' could be '0xafb0ccc0U'

Signed-off-by: XueBing Chen <chenxuebing@jari.cn>
---
 arch/x86/math-emu/poly_l2.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/math-emu/poly_l2.c b/arch/x86/math-emu/poly_l2.c
index 98b6949bb854..ffb5d84467d6 100644
--- a/arch/x86/math-emu/poly_l2.c
+++ b/arch/x86/math-emu/poly_l2.c
@@ -19,14 +19,14 @@
 #include "poly.h"
 
 static void log2_kernel(FPU_REG const *arg, u_char argsign,
-			Xsig * accum_result, long int *expon);
+			Xsig * accum_result, long *expon);
 
 /*--- poly_l2() -------------------------------------------------------------+
  |   Base 2 logarithm by a polynomial approximation.                         |
  +---------------------------------------------------------------------------*/
 void poly_l2(FPU_REG *st0_ptr, FPU_REG *st1_ptr, u_char st1_sign)
 {
-	long int exponent, expon, expon_expon;
+	long exponent, expon, expon_expon;
 	Xsig accumulator, expon_accum, yaccum;
 	u_char sign, argsign;
 	FPU_REG x;
@@ -35,7 +35,7 @@ void poly_l2(FPU_REG *st0_ptr, FPU_REG *st1_ptr, u_char st1_sign)
 	exponent = exponent16(st0_ptr);
 
 	/* From st0_ptr, make a number > sqrt(2)/2 and < sqrt(2) */
-	if (st0_ptr->sigh > (unsigned)0xb504f334) {
+	if (st0_ptr->sigh > 0xb504f334U) {
 		/* Treat as  sqrt(2)/2 < st0_ptr < 1 */
 		significand(&x) = -significand(st0_ptr);
 		setexponent16(&x, -1);
@@ -104,10 +104,10 @@ void poly_l2(FPU_REG *st0_ptr, FPU_REG *st1_ptr, u_char st1_sign)
  |   log2(x+1)                                                               |
  +---------------------------------------------------------------------------*/
 int poly_l2p1(u_char sign0, u_char sign1,
-	      FPU_REG * st0_ptr, FPU_REG * st1_ptr, FPU_REG * dest)
+	      FPU_REG *st0_ptr, FPU_REG *st1_ptr, FPU_REG *dest)
 {
 	u_char tag;
-	long int exponent;
+	long exponent;
 	Xsig accumulator, yaccum;
 
 	if (exponent16(st0_ptr) < 0) {
@@ -180,9 +180,9 @@ static const unsigned long leadterm = 0xb8000000;
  |   log2(x+1)                                                               |
  +---------------------------------------------------------------------------*/
 static void log2_kernel(FPU_REG const *arg, u_char argsign, Xsig *accum_result,
-			long int *expon)
+			long *expon)
 {
-	long int exponent, adj;
+	long exponent, adj;
 	unsigned long long Xsq;
 	Xsig accumulator, Numer, Denom, argSignif, arg_signif;
 
@@ -210,7 +210,7 @@ static void log2_kernel(FPU_REG const *arg, u_char argsign, Xsig *accum_result,
 #ifndef PECULIAR_486
 	/* Should check here that  |local_arg|  is within the valid range */
 	if (exponent >= -2) {
-		if ((exponent > -2) || (argSignif.msw > (unsigned)0xafb0ccc0)) {
+		if ((exponent > -2) || (argSignif.msw > 0xafb0ccc0U)) {
 			/* The argument is too large */
 		}
 	}
-- 
2.36.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-29 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-29 15:06 [PATCH] x86: clean up warnings found by checkpatch XueBing Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).