Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp349809lqb; Thu, 29 Feb 2024 02:57:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYIhj/0yDddUnTZrW46VPil3Y/Fu3dOO95q9hTnbLYpsu2DDhKszp2UGrfgknKEr2OLFnIqE1UrqoQd4NQA5QkMPDEgzrdG0iL6twIqg== X-Google-Smtp-Source: AGHT+IGvkSbo4Rtnvd/ScDA1kLyUuQcUQdW1IzKsoDlgnoVoHV0UOiU16T6fe2b3XcinfPSFl4h2 X-Received: by 2002:a9d:4d13:0:b0:6e4:c313:7d54 with SMTP id n19-20020a9d4d13000000b006e4c3137d54mr665008otf.15.1709204255500; Thu, 29 Feb 2024 02:57:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709204255; cv=pass; d=google.com; s=arc-20160816; b=XMVuj8BvMWZC0CMJRmgEBFS0VmVRnyDCPOVkzJHVNzQxc9c5PgvfzcxA2q+jjyBUON nE0OK6wCs+mRrR9o/TBNByWTKzR4PLhVRV4hmzQ9/WgfOLnjoTdCwUCfoeyEa5MrrYRR BXtAIWq7mHNvA1wcuvX9BvYVvKqygrpgHBelPpY9Mb1gH4bIfN1gzADAYEJ2ww4IREd9 otgA32JAvrX64JQb1RyGhgl8mkn5KZinx34HiA4seCkHvcucs9uvwbZKCqC+Si2ZtFbI zeGKDRB9fxMnbsbcek3ZaEzWSqmz0TDR/v3BRE5rkJIOoDGaGYZ5efkHfB8n/Z9EdYfF NCyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=EjmhbjWuzGsgjjm3fTdFbj85GE2u6BwQsPltwIgNwV4=; fh=YLgIcMi+Vak/ZwJ7tX0I648rDDbrU/Mia2/6gqp6vts=; b=ZAqDNzuTpt0j3UNTGP6rNs0QdaGflYQKPkzFwWAiRD3gUjw6oiX8A5BUrfsJEg3ZNn AOxgkZbxDbsvx254/qtOtsUfHln1J4trG1LAq6YJYD4cmmM0BwnjwWd5DEakA2quqR2J pPD+FNs5CR/rl+/U2+xsWgQ6ZHkS16VLl/wA66RWdHpv6me2p2ghyYmzWZJvdhQ+1jX1 UJHOT3zF2Ga3Ph8hHqqxl+YNakplFtsqG4Dcg7BZ+EEtR7w8n4eZQA/bfDx6GjmsQ7VM VBWElqqdBhULJsuxqcLa3qGyhXlPPmbsvN60qaai7eo3ky5qRa7XxtnZQ5D1fKjqyaT8 gu9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-86592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cb15-20020a056a02070f00b005e4a4aa2528si794578pgb.48.2024.02.29.02.57.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:57:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-86592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2B3652890DA for ; Thu, 29 Feb 2024 10:57:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 350F87A71D; Thu, 29 Feb 2024 10:57:29 +0000 (UTC) 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: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemd200013.china.huawei.com (7.221.188.133) Clean up one temporary variable to simplifiy code in capability detection. Signed-off-by: Liao Chang --- 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 = !!(scope_mask & SCOPE_BOOT_CPU); for (i = 0; i < ARM64_NCAPS; i++) { - unsigned int num; - caps = cpucap_ptrs[i]; - if (!caps || !(caps->type & scope_mask)) - continue; - num = caps->capability; - if (!cpus_have_cap(num)) + if (!caps || !(caps->type & scope_mask) || + !cpus_have_cap(caps->capability)) continue; if (boot_scope && caps->cpu_enable) -- 2.34.1