Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp490042lqd; Wed, 24 Apr 2024 08:17:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUw0uKYrWwVyrwzZbOvy5C/1xH1K7TBvX3jWAPCzrLvi1GsC6Zb4PEwoWEgcg+zUN7WplNTowytbT99ttGGKxM0wpppm4aMfgXhkpyacw== X-Google-Smtp-Source: AGHT+IEO0cHKs//bQjhydmPVr/rtgkl77rwmpwGaAkInb1hi3Cw6NvSJTeJvMVdexeLuV/riS3EF X-Received: by 2002:a05:6e02:1a2e:b0:36b:fa6e:5be1 with SMTP id g14-20020a056e021a2e00b0036bfa6e5be1mr3328990ile.20.1713971832212; Wed, 24 Apr 2024 08:17:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713971832; cv=pass; d=google.com; s=arc-20160816; b=HLOVgpr5vjB3h1kDIPmfEPJGeKBqLCh0xOlS6CBDFa5Zd8bdu+lrzek7bj81hU8OtL w/mbtg0dBouFMB7oIEkC5TKUCAiS7wn+9vfmnn1BQQqDLpySKAp73SWGgZIYqEuEae3s KYLJVWpTFQ93EOB/BglrtOmE4IdCrv+dO3rjn5XrduGnqUbIsKg2rMiPOREBnqFzM1bd qN5JJiZ7W63DHYBoYJWXWNBvaC6OMqpax4ey50QDenvmXAPBNEbvcOfW+EDw6G1S59VZ y88hUEzgfQv5autoTpaBsrWm3yUG4Y6y0JMpoOKpmZOXMGqAdXado7qqk0gnbG8/v7uf cRwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EkBE66CT6crj6GkqyX5V53CXIn7FtqQLU888aU+APFw=; fh=K26DKzYchxV6G/1AFT/1vsPB+Vm9Ct6dD/WiMvK4ogE=; b=ZFpB6Ut3mDdefRbie9jso1HfUlu3n9og2e213cyF+J3J/s9jJSbTxs+5EubazIc15r 2C8yoUYK7XKR8pbZg2mPRL6CzJj8MgcTKUZ2RYDbN8cR4gPBYyYo5eeJGJ3peSCg6dXG Vq5r/zg/t+NbK/OQL9lzyWwDHqXhjnHerHXwuU/iucG5Yh/BxGtYjKOm9HKjwCS2X8gD 3ZRjrpXV1UUoYaM8KCJDHVVdHEbYaZvncMvZ1fFWw8dmBzkWDSI0TD5yIIEGQy6wJNoT JKL0UX37kNA/GBTp76S+97K4ACBWV97DGFCUwHqZrcPcemYaMcJWx2lhN6TU/vhGiPM/ 9KbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pVGfFKG4; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-157169-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157169-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x22-20020a63b216000000b005f7bedc5280si9788913pge.328.2024.04.24.08.17.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157169-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pVGfFKG4; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-157169-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157169-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3393B2893B1 for ; Wed, 24 Apr 2024 15:11:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CEED15F306; Wed, 24 Apr 2024 15:11:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pVGfFKG4" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 6789915E1F5; Wed, 24 Apr 2024 15:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713971511; cv=none; b=Ud+9JIN1MmQ7bBg8KLh76roaxbGOItIYCrvaADoRzlCWXtz3RArD3rU6DMC1OpYI+7uzUo6yjEZh2mlbCSMn+XNfIzcw7EI6nayLeDzbSiDPjOMoF+ap9LmR1755PQPHKhZa6RvZC3Hcb+Q33MRzFWVkzXk8wcS9qZAqRkd5AeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713971511; c=relaxed/simple; bh=sGf5KeOvU8gGZ4+R+esrn6WEfp7xeYgJH0s+dTSO4k0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XbuVApypUTlkK1cVyIyNSBOf2MYlnYil1OTuuyfPw+zhsTmR4i1YkL9suv/7vGU/fRVgWouA7TCbHLlmsI+fI48I8WWCvXtMEoIXQ4h4TIDunxOWO19rsy6u1Mny1xoSKlqb5C3IICf4MnGvJE+l73CZmIub4Me9tTMuxFWO63Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=pVGfFKG4; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EkBE66CT6crj6GkqyX5V53CXIn7FtqQLU888aU+APFw=; b=pVGfFKG43UpmS74CNpKosVr5aW DiWq78bfE/4XpvD6h++sMM7pvdJKjA8UOxzoT7aLqgK7wZaHJ+nbEA3Nc9XKmElw8EL6cEbeyoIIm ccRUoz7uUY0OrHfgDHqvVw1lXK7iT7mUgNT1EQzTmRxqscWpsG207rz33DabNMrsUc9mar0BuL5Ku 0PG8jBvtTxrk8wl80BfvKMLzUlsffHyjR/9ZpZveIqAVomDlFkK8mQzDaUM8LzboXOzb/rdONx1SY YFFTBziyw63gs/sXKceSMYFTE1TRYwUIdqMtNrY/bXgCF31DJfi6cJPV3sC8K5+u/BVX9o77r5qE1 O78+0gHA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzeHV-000000018cB-3diq; Wed, 24 Apr 2024 15:11:33 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 8368C30043E; Wed, 24 Apr 2024 17:11:33 +0200 (CEST) Date: Wed, 24 Apr 2024 17:11:33 +0200 From: Peter Zijlstra To: Adrian Hunter Cc: Thomas Gleixner , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Vincenzo Frascino , John Stultz , Stephen Boyd , Randy Dunlap , Bjorn Helgaas , Arnd Bergmann , Anna-Maria Behnsen , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH V2 04/19] math64: Tidy mul_u64_u32_shr() Message-ID: <20240424151133.GR30852@noisy.programming.kicks-ass.net> References: <20240325064023.2997-1-adrian.hunter@intel.com> <20240325064023.2997-5-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325064023.2997-5-adrian.hunter@intel.com> On Mon, Mar 25, 2024 at 08:40:08AM +0200, Adrian Hunter wrote: > Put together declaration and initialization of local variables. > > Suggested-by: Thomas Gleixner > Signed-off-by: Adrian Hunter > --- Nothing wrong with this patch, but it is highly unlikely this code is actually tested much. Most (sane) architectures will use the __int128 version. > include/linux/math64.h | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/include/linux/math64.h b/include/linux/math64.h > index bf74478926d4..fd13622b2056 100644 > --- a/include/linux/math64.h > +++ b/include/linux/math64.h > @@ -179,16 +179,12 @@ static __always_inline u64 mul_u64_u64_shr(u64 a, u64 mul, unsigned int shift) > #ifndef mul_u64_u32_shr > static __always_inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) > { > - u32 ah, al; > + u32 ah = a >> 32, al = a; > u64 ret; > > - al = a; > - ah = a >> 32; > - > ret = mul_u32_u32(al, mul) >> shift; > if (ah) > ret += mul_u32_u32(ah, mul) << (32 - shift); > - > return ret; > } > #endif /* mul_u64_u32_shr */ > -- > 2.34.1 >