From nobody Sun Feb 8 19:25:41 2026 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (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 C2E4A6351C for ; Thu, 29 Feb 2024 10:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709204248; cv=none; b=LLnW+wteSHYkJm3Z+SDlsk4vOsDe36U2ZcNptn12G1ouH+IXLSXIhrfjO0TeawhEFtplTzCNJV8Yo5gMLgRGMQs5m4ugGazXUIVKUFSPDez+D1aV94elh5DPUmpJ5IZeZC7aZys3ApMFjwZ1N1bBm7ksKdDDYxnlM4cN4A2+IwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709204248; c=relaxed/simple; bh=mlQriLFckdSfeNQ7AaJtv9Q/udzqXN7eCK5x+5iiUfg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=GZKZUWiwbnZmVK/IRqG9Alek6nLQtBI/3Z6zmPkVBJy9/wZEXF1tP7gqoIzamMZy69kg0kLB5P0VFZom3IEputl3eqmu3tXpUJXI/oZ0SH6EtquwxXUHmTd6wQRYjy1/2w9fm3SL+H4b4rkXSKEr0hJYcuc/vdq5DUmBuDWsDpE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Tlp5l1mq0z2BdZj; Thu, 29 Feb 2024 18:55:07 +0800 (CST) Received: from kwepemd100005.china.huawei.com (unknown [7.221.188.91]) by mail.maildlp.com (Postfix) with ESMTPS id 1FAC5140390; Thu, 29 Feb 2024 18:57:23 +0800 (CST) Received: from kwepemd200013.china.huawei.com (7.221.188.133) by kwepemd100005.china.huawei.com (7.221.188.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Thu, 29 Feb 2024 18:57:22 +0800 Received: from huawei.com (10.67.174.28) by kwepemd200013.china.huawei.com (7.221.188.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Thu, 29 Feb 2024 18:57:22 +0800 From: Liao Chang To: , , , , , , , , , CC: , Subject: [PATCH] arm64: cpufeatures: Clean up temporary variable to simplify code Date: Thu, 29 Feb 2024 10:52:08 +0000 Message-ID: <20240229105208.456704-1-liaochang1@huawei.com> X-Mailer: git-send-email 2.34.1 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: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd200013.china.huawei.com (7.221.188.133) Content-Type: text/plain; charset="utf-8" Clean up one temporary variable to simplifiy code in capability detection. Signed-off-by: Liao Chang Acked-by: Mark Rutland Reviewed-by: Jeremy Linton --- arch/arm64/kernel/cpufeature.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 8d1a634a403e..0e900b23f7ab 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -3052,13 +3052,9 @@ static void __init enable_cpu_capabilities(u16 scope= _mask) boot_scope =3D !!(scope_mask & SCOPE_BOOT_CPU); =20 for (i =3D 0; i < ARM64_NCAPS; i++) { - unsigned int num; - caps =3D cpucap_ptrs[i]; - if (!caps || !(caps->type & scope_mask)) - continue; - num =3D caps->capability; - if (!cpus_have_cap(num)) + if (!caps || !(caps->type & scope_mask) || + !cpus_have_cap(caps->capability)) continue; =20 if (boot_scope && caps->cpu_enable) --=20 2.34.1