Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp33056842rwd; Sat, 8 Jul 2023 04:30:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEMbmniIR3Isb3p3iGldpzKiJMjCQQdOIddVeXfUdDBf0pQs9qT60ttw15EWlBgXht3L9T2 X-Received: by 2002:a05:6a00:2307:b0:67e:18c6:d2c6 with SMTP id h7-20020a056a00230700b0067e18c6d2c6mr9408341pfh.5.1688815858289; Sat, 08 Jul 2023 04:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688815858; cv=none; d=google.com; s=arc-20160816; b=OoxkawyXnRh+l5oVyn+mJO9EYJ0rU6fgaBmPKDInT9VPjWV0AErxDhevXFWWKcykpV 8He/QlQFHdeVMUmoZ7hMDOxzT/6ulr90SIzVM0LxZ+8MiF5Ogxs/LqLitMZxfPy68wLW 7c2NtMXugHUInFJKKIqUeYGK9HPx+ZuJbDbo2PYvsRN4n8+YfJZlXz9IjqMcJbNpW3LU 42xrLPnDPpYtu7wKkpUY4nineMSgn2H2EPOfFh6t+XkIZulRcSue6JZaNH7EwunYIOY9 EKRvOtpi6Swi9oTIIWNAyJuzZGE6MbyZaBLvj2twvFJ7xv4sQD1LAU3h2l7v2iSv2QB4 CFrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6bkRzeJg53mut3YjVfLw0eXnrff4hl32x6+fj2E+jYo=; fh=oREYu+TWeGQMqNDlsk9ppZjkWQIjn+uvG0Vh9DLIc6Y=; b=FaLwBC5o9xJCPEW2pqqWYxjniXJwVZTHzJqZPJhdd3QgrAJITqVIzWmY88LnF7NC5v eWotX3zcIPS7yWx36OL9CxKO1z5FzOzF7JCLU1bSFXeI0V3HvvFzwPYho9mzQcKvECsq Mq7Ytzky4RkHeU4k5MOz/NP4XUOaBEaQdiwQG50b0Szln7sPWFKoibrTHgqq7SYWH3pl BcvwQ+iR9scLwE2B7BaJvUfg9DbyAVvTyCLG6m/MqXrBaH+lBRAMqVeXtWjLJ+v9h/iY 0nOGylaBcPsr3cBb31ZyACkpk0188FZiYtwyrPHUp343lNnfsDTRcStM4Nwkx9kBfNxX RDYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020a056a00099800b0064d28b68d8fsi5859485pfg.94.2023.07.08.04.30.37; Sat, 08 Jul 2023 04:30:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjGHL1h (ORCPT + 99 others); Sat, 8 Jul 2023 07:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjGHL1h (ORCPT ); Sat, 8 Jul 2023 07:27:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3226F1997 for ; Sat, 8 Jul 2023 04:27:36 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qI662-0002LD-TC; Sat, 08 Jul 2023 13:27:26 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qI662-00CwkH-7G; Sat, 08 Jul 2023 13:27:26 +0200 Received: from afa by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qI662-00C9mA-0N; Sat, 08 Jul 2023 13:27:26 +0200 From: Ahmad Fatoum To: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui Cc: kernel@pengutronix.de, Ahmad Fatoum , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] thermal: core: constify params in thermal_zone_device_register Date: Sat, 8 Jul 2023 13:27:19 +0200 Message-Id: <20230708112720.2897484-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure"), thermal_zone_device_register() allocates a copy of the tzp argument and callers need not explicitly manage its lifetime. This means the function no longer cares about the parameter being mutable, so constify it. No functional change. Fixes: 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure") Signed-off-by: Ahmad Fatoum --- drivers/thermal/thermal_core.c | 4 ++-- include/linux/thermal.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 842f678c1c3e..cc2b5e81c620 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1203,7 +1203,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp); struct thermal_zone_device * thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *trips, int num_trips, int mask, void *devdata, struct thermal_zone_device_ops *ops, - struct thermal_zone_params *tzp, int passive_delay, + const struct thermal_zone_params *tzp, int passive_delay, int polling_delay) { struct thermal_zone_device *tz; @@ -1371,7 +1371,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask, void *devdata, struct thermal_zone_device_ops *ops, - struct thermal_zone_params *tzp, int passive_delay, + const struct thermal_zone_params *tzp, int passive_delay, int polling_delay) { return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask, diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 87837094d549..dee66ade89a0 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -301,14 +301,14 @@ int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp); #ifdef CONFIG_THERMAL struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, void *, struct thermal_zone_device_ops *, - struct thermal_zone_params *, int, int); + const struct thermal_zone_params *, int, int); void thermal_zone_device_unregister(struct thermal_zone_device *); struct thermal_zone_device * thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int, void *, struct thermal_zone_device_ops *, - struct thermal_zone_params *, int, int); + const struct thermal_zone_params *, int, int); void *thermal_zone_device_priv(struct thermal_zone_device *tzd); const char *thermal_zone_device_type(struct thermal_zone_device *tzd); @@ -348,7 +348,7 @@ void thermal_zone_device_critical(struct thermal_zone_device *tz); static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, struct thermal_zone_device_ops *ops, - struct thermal_zone_params *tzp, + const struct thermal_zone_params *tzp, int passive_delay, int polling_delay) { return ERR_PTR(-ENODEV); } static inline void thermal_zone_device_unregister( -- 2.39.2