From nobody Sun Oct 5 01:49:55 2025 Received: from baidu.com (mx22.baidu.com [220.181.50.185]) (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 39C2B275AE4 for ; Mon, 11 Aug 2025 06:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.181.50.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754894103; cv=none; b=ipNgGTfo6K8Cveonphn9m9lREHZLCvBoM8O37nWcJrR7qhVHgpOwzpM5cONeLadan0rsUgGTGAJTzNlz5mRkY/kUEtl4NgHPCzegGZfnZLx0wXYt1252k9YceOhU4wzJLI0twPkj2UmTaoxtjx6VALK5Lt+LydHwMlKUVoEpRDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754894103; c=relaxed/simple; bh=oOVkSModVj6oy67yH3vCuzlfZcVVnejd0mcHgqGcQ3c=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=jpMJBNrA5EqESGaAs8jYX5yBvxxxQtsnsM+UqbWPoA5LMyPG4xTGT6mAfpgqyO0N+rkFu5E7XNKHOUZGDOM1StxQHyLu6fCYYtFoK2wAzkVIQLVvdsmmRG33ZHQXpIFH336SOJCw2DvZUM1QFB74nAo44LclKGZPg5PKLbTF9d0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; arc=none smtp.client-ip=220.181.50.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com From: Fushuai Wang To: , CC: , , , , , , , , , Fushuai Wang Subject: [PATCH] riscv: Use for_each_online_cpu() instead of for_each_cpu() Date: Mon, 11 Aug 2025 14:33:52 +0800 Message-ID: <20250811063352.1770-1-wangfushuai@baidu.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) 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 X-ClientProxiedBy: bjhj-exc11.internal.baidu.com (172.31.3.21) To bjhj-exc17.internal.baidu.com (172.31.4.15) X-FEAS-Client-IP: 172.31.4.15 X-FE-Policy-ID: 52:10:53:SYSTEM Content-Type: text/plain; charset="utf-8" Replace the opencoded for_each_cpu(cpu, cpu_online_mask) loop with the more readable and equivalent for_each_online_cpu(cpu) macro. Signed-off-by: Fushuai Wang Reviewed-by: Jesse Taube --- arch/riscv/kernel/unaligned_access_speed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel= /unaligned_access_speed.c index ae2068425fbc..5e11b1bd9b2a 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -150,7 +150,7 @@ static void __init check_unaligned_access_speed_all_cpu= s(void) * Allocate separate buffers for each CPU so there's no fighting over * cache lines. */ - for_each_cpu(cpu, cpu_online_mask) { + for_each_online_cpu(cpu) { bufs[cpu] =3D alloc_pages(GFP_KERNEL, MISALIGNED_BUFFER_ORDER); if (!bufs[cpu]) { pr_warn("Allocation failure, not measuring misaligned performance\n"); @@ -165,7 +165,7 @@ static void __init check_unaligned_access_speed_all_cpu= s(void) smp_call_on_cpu(0, check_unaligned_access, bufs[0], true); =20 out: - for_each_cpu(cpu, cpu_online_mask) { + for_each_online_cpu(cpu) { if (bufs[cpu]) __free_pages(bufs[cpu], MISALIGNED_BUFFER_ORDER); } --=20 2.36.1