Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp357411lqb; Thu, 29 Feb 2024 03:10:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUwrCRhfS6MeVAYF4fQrnTgF0+HtrNrkhuu2Czkk5ceSp/zLlTxUuq4FCF+5b4gK7QwHzIwEIbyOfYk2yVOOLu0r3i3Pz10KzQAlNlfKA== X-Google-Smtp-Source: AGHT+IFhfL70KjUqQFPjjNeFmgcqmd27vf1rkzAaGkdl+ij2/j8LU0GzX9TNSjkfSe8lSZgK4/Uf X-Received: by 2002:a17:902:ced0:b0:1dc:43d:962 with SMTP id d16-20020a170902ced000b001dc043d0962mr2134601plg.42.1709205053459; Thu, 29 Feb 2024 03:10:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709205053; cv=pass; d=google.com; s=arc-20160816; b=ioqm70Zm31BKIFQzQ6zAjHgsSS2EBMxyZGkFS90YE6Lwu1UEPnb1YEVTcBCXBrYD/g K3nNvPLYB5weQJzWHlRwNrIqOXS8ym8yCLCULqgBaQ2bIpRafp4ebv/EtCrqq52zFGDT 5NyOPacl6FvM996fRsxmCbVJJ1ye8OXP6OvulgqF7f7h7oM5F0DAwszQbPqD0Ds1TxPg 6XnZlgeIQELTHKfzjMY8SGpf4V1lQLGm9qPZ5aQJQjGMmMIC6rQZtt5pfML8iNui9ou2 TdsE7HWrJ5rGOVgM3PIH7zzIEh/cI9AvbACDgaEJ4V8NqDsHOVzT0pVbnaC+ch3t+50x FEyA== 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; bh=D/Ubxqty0QrzeZMTsKivfiLP4D4SEUN8sy645Cpkxbg=; fh=TFr7CaulzGALmAf4vfu4dyihn6u1vODwxSK2HSf1XVc=; b=Htrxrl5C0Sq4yM3gfJpMcSoxEY5bP8ykNDR4+CHVn23hqNez/JH2B+czwXFGy0sWTg V7OH93nLaWXC4xMdAAl0dKpm0nP7eAKqPI4WvGr3zpTx283i1fbSUbNuc6meG6hgPJ28 gYHC7ssadubAQW+stMU+f2gzEWKg7+bsOdiAU4GmRAgZsutoahDhxfErK5bI5E2HlnTM prPYt1SfKoVYkSOWbo9ysj37ibz9LF6F+872MrbaUn+v15idNvUWvo6kdE3YbiNTK318 y2Gc7yY57HMuquCLCduY90mBdko4wrBBGPvb1+shOLrBVjLd+UT+DmgTcYPHznV9FUQj k68w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-86607-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86607-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e17-20020a170902f1d100b001d3c375bff6si1019882plc.534.2024.02.29.03.10.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 03:10:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86607-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-86607-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86607-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 249F2289AAB for ; Thu, 29 Feb 2024 11:10:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38CB97AE5E; Thu, 29 Feb 2024 11:10:47 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5497A7A73F for ; Thu, 29 Feb 2024 11:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709205046; cv=none; b=HHllVzFF8yYKkI+BKOZp/12WUqGZSwsQL/stlG4FffC+3aGIMa38G6Iff4xsjJqsRVt2SYWGZusrvru7NC7WGwZ9X/8wPHge7ON5GxRjCiwvH+hKri/kdcme/GNQxZD9WBqG3QdCNohPclIBuG6Y4RNB2O0gui76D84rhOe8lnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709205046; c=relaxed/simple; bh=gnJYMBD5vxbFQv3VEdHFXgM/A+bEYir69Dix+1doZkc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hWucDsySBkzfvSMVaqW/Auqwh34BYc884pbbAyJUhJG8atv+ghxR9GEUpkAP7hVg/51SoSEyCUNC9zdVt/11eGMtHdibo8yp82i6Itod+OQYrur+HOBZKZwPnWuxlvsbGBlCTWjsrsw2m8tY0YgfnCqbHQoHAjnwa/1GRBjlegU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3D16A1FB; Thu, 29 Feb 2024 03:11:21 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.67.138]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 617D63F762; Thu, 29 Feb 2024 03:10:40 -0800 (PST) Date: Thu, 29 Feb 2024 11:10:37 +0000 From: Mark Rutland To: Liao Chang Cc: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org, maz@kernel.org, joey.gouly@arm.com, kristina.martsenko@arm.com, ryan.roberts@arm.com, jeremy.linton@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: cpufeatures: Clean up temporary variable to simplify code Message-ID: References: <20240229105208.456704-1-liaochang1@huawei.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: <20240229105208.456704-1-liaochang1@huawei.com> On Thu, Feb 29, 2024 at 10:52:08AM +0000, Liao Chang wrote: > Clean up one temporary variable to simplifiy code in capability > detection. > > Signed-off-by: Liao Chang This looks line a nice cleanup, so: Acked-by: Mark Rutland For context, we removed the last other user of 'num' in commit: 21fb26bfb01ffe0d ("arm64: alternatives: add alternative_has_feature_*()") Mark. > --- > 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 >