From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 BBB6013D8A4; Wed, 3 Sep 2025 00:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756860688; cv=none; b=RR2iNL1MoatBeFcuVhoQy8nIudinRkk+8d5DeYOxU/tIFnf0hYNNWaK1Q/hsrEBKN6QGR0PV39wZDF+194N/A7DxfVwZ2KVowmnfajrCH0fkNq4e+iUZhLggT1BUdv98g9T/jUvgfj4+Y8gVLBrffwqvrzv8UkWoeQJKohevP+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756860688; c=relaxed/simple; bh=SWn2YoMWlNMEPB8MPyZq3aGVAkzLGIwvqZCBCqopq50=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GW6RtB6MlDJ9htREGdIJgqvhIKFRdlP424Nz5dBiuPYhaBEZmJfR0hD0WFiASDpejpJabmN7qAcI+eQlad9fZZegB7B+xOSkZC7gHJIwNB5iwKaEro4v6DOtPFsb+Spc1QRyq5rBLuaoCMPvCHpDDdbrnwUG6mi1UB/NXf26Otg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 1864b9c6886011f0b29709d653e92f7d-20250903 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:149e317a-1aff-43d6-90c9-1a5d04dd57b0,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6493067,CLOUDID:461f970947de3929c2a541614ce8e229,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:80|81|82|83|102,TC:nil,Content:0|52,EDM: -3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0, AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 1864b9c6886011f0b29709d653e92f7d-20250903 Received: from mail.kylinos.cn [(10.44.16.175)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA) with ESMTP id 1164660955; Wed, 03 Sep 2025 08:51:15 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 22D4BE008FA3; Wed, 3 Sep 2025 08:51:15 +0800 (CST) X-ns-mid: postfix-68B79102-9412696 Received: from [172.25.120.24] (unknown [172.25.120.24]) by mail.kylinos.cn (NSMail) with ESMTPA id 28EDFE008FA2; Wed, 3 Sep 2025 08:51:07 +0800 (CST) Message-ID: <40706b1f-e23c-417b-b3e1-2dc839828588@kylinos.cn> Date: Wed, 3 Sep 2025 08:51:06 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 03/12] cpufreq: intel_pstate: Use scope-based cleanup helper To: "Rafael J. Wysocki" Cc: Viresh Kumar , Catalin Marinas , Will Deacon , Borislav Petkov , Dave Hansen , Srinivas Pandruvada , Michael Ellerman , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Jani Nikula , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Daniel Lezcano , Sascha Hauer , Shawn Guo , Eduardo Valentin , Keerthy , Ben Horgan , zhenglifeng , Zhang Rui , Len Brown , Lukasz Luba , Pengutronix Kernel Team , Beata Michalska , Fabio Estevam , Pavel Machek , Sumit Gupta , Prasanna Kumar T S M , Sudeep Holla , Yicong Yang , linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250901085748.36795-1-zhangzihuan@kylinos.cn> <20250901085748.36795-4-zhangzihuan@kylinos.cn> <29890791-4ddf-49c7-a4f2-0ac83e6d53c6@kylinos.cn> From: Zihuan Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable =E5=9C=A8 2025/9/2 19:47, Rafael J. Wysocki =E5=86=99=E9=81=93: > On Tue, Sep 2, 2025 at 12:33=E2=80=AFPM Zihuan Zhang wrote: >> >> =E5=9C=A8 2025/9/1 23:17, Rafael J. Wysocki =E5=86=99=E9=81=93: >>> On Mon, Sep 1, 2025 at 10:58=E2=80=AFAM Zihuan Zhang wrote: >>>> Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy) >>>> annotation for policy references. This reduces the risk of reference >>>> counting mistakes and aligns the code with the latest kernel style. >>>> >>>> No functional change intended. >>>> >>>> Signed-off-by: Zihuan Zhang >>>> --- >>>> drivers/cpufreq/intel_pstate.c | 8 +++----- >>>> 1 file changed, 3 insertions(+), 5 deletions(-) >>>> >>>> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_= pstate.c >>>> index f366d35c5840..4abc1ef2d2b0 100644 >>>> --- a/drivers/cpufreq/intel_pstate.c >>>> +++ b/drivers/cpufreq/intel_pstate.c >>>> @@ -1502,9 +1502,8 @@ static void __intel_pstate_update_max_freq(str= uct cpufreq_policy *policy, >>>> >>>> static bool intel_pstate_update_max_freq(struct cpudata *cpudata) >>>> { >>>> - struct cpufreq_policy *policy __free(put_cpufreq_policy); >>>> + struct cpufreq_policy *policy __free(put_cpufreq_policy) =3D= cpufreq_cpu_get(cpudata->cpu); >>>> >>>> - policy =3D cpufreq_cpu_get(cpudata->cpu); >>>> if (!policy) >>>> return false; >>> The structure of the code is intentional here and there's no reason t= o >>> change it. >> >> Got it. Thanks for clarifying. >> >> So for this case the current structure is intentional - > Note that I'm talking about this particular change only. The other > change in the $subject patch is fine. > >> should I also avoid similar changes in other drivers? > That depends on who maintains them, which is why I wanted you to split > the patch into smaller changes in the first place. > > My personal view is that code formatting changes, which effectively is > what this particular one is, are pointless unless they make the code > much easier to follow. UnderStood, Thanks!