From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F6D2CA0FED for ; Fri, 5 Sep 2025 10:03:19 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4cJBkG25b7z301n; Fri, 5 Sep 2025 20:03:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1757066598; cv=none; b=F4BN6PZAtHG8+xkK1dqtLRJZ38SFRWZ98Ru+ZDk7DN5VWvyNB379KJipSEncmUtI2EjEUHJgQz6TMNahf8e21ls2v8KNkCVEpEZkzayp7Ly97meC8qGWhghO+XLKKUq9qN55ZuJl41dS7uXR60+Jy+heuaJdwoqYKPbQciZsDQKvvYJahRvWe4Hw5cYHb8ku2Re3D16VlG59GE6ppCrFT2rvOknmIaBomU05y9IfxDBkMEIL1mjhz2R2SWTSmSWjzptGk4zfe+VdQWMNXwietOcO8fAE97ndOA27V5jllUTgUcrlId6Opd5fOs6dWNraxLZnCS5n58sjFjR+0QLE6w== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1757066598; c=relaxed/relaxed; bh=R+Lpf7yZ9aS/yOm66isk+kAfhb/g8eE+sSJhc6oWqLw=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FM9lDQxqYQu9GVF0OZ0tHfIPqyVG1X+GQUC6dYJuXB/FlieUTmWkO1yAR8/3Cy/8e/HXffYGuFVE3a20Gf42nYJ6HqOxe7+GOH76/8ZI2w6yptF98/2VDXRs5KrGoncHLsytDY7J622dnIQacSGVqxiDzG5JEe3AFTXSMAuSaKxQ9P1l6NVeT/3LhA9e6D7rqVJEA0/TmqBm7HiGScy+jvA9XweSgcIctJ8DRP6haC/73pGGdrV1Sn5pzz8RxzyNnXi7b/gNMeDZU5LM2DT6auOUqfmgTcQdAQshkibnoMkuTqU0FbIEj5qHp7gd1ERHk3VVa8nVWbmk3NZIc1I4Sg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4cJBkF2Kwvz2ySV for ; Fri, 5 Sep 2025 20:03:17 +1000 (AEST) Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4cJBdh2c9dz6L5kC; Fri, 5 Sep 2025 17:59:20 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 37EE21402F1; Fri, 5 Sep 2025 18:03:14 +0800 (CST) Received: from localhost (10.203.177.15) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 5 Sep 2025 12:02:49 +0200 Date: Fri, 5 Sep 2025 11:02:48 +0100 From: Jonathan Cameron To: Zihuan Zhang CC: "Rafael J . wysocki" , 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 , , , , , , , , , Subject: Re: [PATCH v4 06/10] drm/i915: Use scope-based cleanup helper Message-ID: <20250905110248.000058e9@huawei.com> In-Reply-To: <20250903131733.57637-7-zhangzihuan@kylinos.cn> References: <20250903131733.57637-1-zhangzihuan@kylinos.cn> <20250903131733.57637-7-zhangzihuan@kylinos.cn> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.177.15] X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To frapeml500008.china.huawei.com (7.182.85.71) On Wed, 3 Sep 2025 21:17:29 +0800 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 FWIW this one is fine if low impact. Reviewed-by: Jonathan Cameron > --- > drivers/gpu/drm/i915/gt/intel_llc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_llc.c b/drivers/gpu/drm/i915/gt/intel_llc.c > index 1d19c073ba2e..f15e4c0fa54b 100644 > --- a/drivers/gpu/drm/i915/gt/intel_llc.c > +++ b/drivers/gpu/drm/i915/gt/intel_llc.c > @@ -29,13 +29,11 @@ static struct intel_gt *llc_to_gt(struct intel_llc *llc) > > static unsigned int cpu_max_MHz(void) > { > - struct cpufreq_policy *policy; > + struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0); > unsigned int max_khz; > > - policy = cpufreq_cpu_get(0); > if (policy) { > max_khz = policy->cpuinfo.max_freq; > - cpufreq_cpu_put(policy); > } else { > /* > * Default to measured freq if none found, PCU will ensure we