Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2636698lqp; Mon, 25 Mar 2024 05:17:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwes5Q67A7k0HZi2KTcCs+Nxw5J/0IQolQrj9xRhEAbKo5lnf+stx5n0f+TQpaXSnbBxiogyUTyUIJYU5aNG+dZkTJzgRIG4AqqBvcMg== X-Google-Smtp-Source: AGHT+IGT1EjoehYfeIRnY3Y6r8PVFpjwq4xP0nT5+zvDPvGa6tHpyG5ksTsKU6Ha5c0Pbtz6+IkV X-Received: by 2002:a17:906:c287:b0:a4a:3912:9ebe with SMTP id r7-20020a170906c28700b00a4a39129ebemr1361798ejz.27.1711369052440; Mon, 25 Mar 2024 05:17:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711369052; cv=pass; d=google.com; s=arc-20160816; b=KPahA6pJm7F7mjyVpK53chvJurQCHW6jokApyA9bL3/8yjARGq7ILwFGf8t+NL3CLb q/KdB8iT7/W/K/Un8uEXWraBXIU/z9PiaBTgHE5bmjbY2xso2m46sF466rGgzAUURnlo /1ugcAJlDHWr/9u+p6xkiKp3UZvvHKSVm01gK9QUe0vLXU7gCX4Cbh1rKdIwYq8KKIz3 Ovw7njdIaFL9ZI2sEffL5NnvdikoFijHKCh1BVJbsZEsLK8BYOm/ori9v97Tna3wbRmJ xNWFm1o+b+xL8jToFm04KrLIG91bV/UlVqJf/CNuDFRwsPKT53qqr+V2vWWVAuHSzSRt r1GQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=6vre58AYLLPF0ZJoET+CJBDUEr/ZLFBgRHR2eOmzpVk=; fh=wgq3SFFcpYoLsYNr1Fy+HYH2+WGNJgTNu+AnKLa6P2U=; b=Z9tFA2eES6H6x1LjEPVHDiWpFtXbRicBhL9JC8qv5nvT2No9hOmV+moyZy5zx3b7vL Zd1kO4wUNwQxODPj+LVVBDxU/OKiB5piTjkzdXYG9bXJqvLUXlRcLKRS184HIFGwl9DO 6pbP2egmcRkgBxkcaZjNcjK61JpoVL0J7ooH0IgRnPJ3FK9ldWCIWAsIysXNhNF4ktkf zbM7voYMv6EAmBXtPoTfeswCJkaa7h+DmAhfPGjotb6flNcPC3yYbcUu/DKhIK1PgFNT 0wreKDyZH4oWGOlZrGrpjyAUCU/yuuekD5lMo+ZeN/a5ywQxD6LU33fk95IreH6URCiF 3hrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VBfAmxSw; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-116588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id la5-20020a170906ad8500b00a47f28cc738si1138160ejb.714.2024.03.25.05.17.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 05:17:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VBfAmxSw; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-116588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 1E1BD1F376CA for ; Mon, 25 Mar 2024 12:17:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DBB31474C8; Mon, 25 Mar 2024 08:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VBfAmxSw" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 0F1E015EFBD; Mon, 25 Mar 2024 06:41:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348868; cv=none; b=ZcnbHVy4DJblQuGWmTgSXH5hvjwCiAgX3/AgMAicyFypy7/GTZfuCEY1sbJHCPxVXas1dhpL/iLt54kjeXwAkbUyhcz7UwLBi6K8GPV/+Ko4U605fFjYoqyTC4gevbbBpNOc+sJKPXr9IEEXe+Fs6SGLIvjJ5vMzLD3uElCxrpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348868; c=relaxed/simple; bh=xuamuB97LVfxyJSvE4i73CrmF8XOSgafgM3yHCD1nqo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WJwgwf42UfYVb9GtzM4Au7b4uD34u/MV4ezOQSM+DdwAfLzX1LFUfqDlQWE88Bv+g8KYEGmYoq8cLfaHoKFkCPURqB4vqt5RB5KvRDNwaTB5VbB8U9wLiBbmQyAVj6zGxtQZlX71ViJh9K0Ec9yE1VJJhteSVU6+1AaohpRO60w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VBfAmxSw; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711348866; x=1742884866; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xuamuB97LVfxyJSvE4i73CrmF8XOSgafgM3yHCD1nqo=; b=VBfAmxSwBgdrrwCzbrTm2FzySbU9TNxzt/YH/zf8WHDRYCaan3Y0029B Trie5g67Xa3Ds590b5fkpTqaglCV9Muk4kwo09p0PhggO531VEU0W2yzf GyXWOZprCjad0P1zIsE9p6RZicuAgxe/yxr6+iSFDXuOUpyyZ3Wdl+1cL KcXpE6ZXMiP8qRw3rGnB7x+lqYtn56IYj+oIztCvPTN1ruUz3dU6mNHJS cFGsXjkh7SdzwLX137/ifFuD1ySbbIHMKk1tHYSP+f6yV2bIOeERlGN3n LiU1gekwYKIB8Y1cv8Ucq0G+gCxHNOixMsmzNLSH1OBa9QDcCfg6RgeoR g==; X-IronPort-AV: E=McAfee;i="6600,9927,11023"; a="17065143" X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="17065143" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2024 23:41:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="38629583" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.211.155]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2024 23:40:58 -0700 From: Adrian Hunter To: Thomas Gleixner Cc: 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 , Peter Zijlstra , 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: [PATCH V2 04/19] math64: Tidy mul_u64_u32_shr() Date: Mon, 25 Mar 2024 08:40:08 +0200 Message-Id: <20240325064023.2997-5-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240325064023.2997-1-adrian.hunter@intel.com> References: <20240325064023.2997-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit Put together declaration and initialization of local variables. Suggested-by: Thomas Gleixner Signed-off-by: Adrian Hunter --- 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