Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp371308pxv; Thu, 22 Jul 2021 02:09:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaxcqbgsWg8o9VC8r2oir2G3zTyFaCwLMzR11lKoMT/GUG/9soz7baO5y8aR0i3Ls4Dyum X-Received: by 2002:a05:6402:2154:: with SMTP id bq20mr53113518edb.111.1626944969458; Thu, 22 Jul 2021 02:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626944969; cv=none; d=google.com; s=arc-20160816; b=PZKvdkPAGgjLlXoCqbkmVtp+aJQcA6QK2t9VqJLdmtLSVZWu+iaquF01+pmPMNCcOl p3JuE6vBwZ6xkd8iFdYJTWCu7KHZP4cSlw3fjnO6EraAn3AzAreJ1oxUTrgz6eSp41qY Kuzj1jx4/QZFxoZ8yRl3uNvPtqgU8lvZSRmwHioKi+1wyYsHdpkqdmxpTz/2jI2P2AEF yrOqsmqOa8mYoc2Ao/QkbEZk1LDK8FR4XACDVV4ttkrdHU/O+ww/1ke+/AOwe1gC+XV+ dv9kbt/nk23bWtZB7iiyfLExVQG3gxZ6l/C4TFzCTStTo+XremeoSkPKJnp0jPJLvhvr D1Lw== 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:dkim-signature; bh=Fx5t9QU8PXU9z8gEhHfizQsf5RaqNhovfufzrOCt+sA=; b=mv9WNgPJNXGUuRrM2ElgT04yuCSsuisCnhAEtPM+6qhJfEBR5/8xD7aEUqK3bTwRZX sIn8ouzuunei3bT5Yd2c9V0yihSRiPq/l4uXcNImXIjXjCGUFE+7/+AKTHoQMz2zwa/B 8YxA90mekaW2kkgBPmFm0Ov2w5W3GWZ9cILkBClhl303KLflJxOtYH/sh+9CCrduCzqi 8J/xuD2gf0yD082rVseXRrA6pEFcuTcTl7hNnaBAkBttNQSyGBoZQrQiy+FyeaMpObty jq5DCiSzy7dxGsAmvFfw7F83skPS6tXesyn31h22BZvOesdvX8K+JHlT2Fqw3V8+rctI 6Ncw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KQeV/yh9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh6si2510350edb.138.2021.07.22.02.09.05; Thu, 22 Jul 2021 02:09:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KQeV/yh9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbhGVI0r (ORCPT + 99 others); Thu, 22 Jul 2021 04:26:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:60408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230419AbhGVI0r (ORCPT ); Thu, 22 Jul 2021 04:26:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3EC9B610F7; Thu, 22 Jul 2021 09:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626944842; bh=G6uggNtHBw06DrLEyrx3+EPLEQiuV1JfBOJ1R+sWWJ8=; h=From:To:Cc:Subject:Date:From; b=KQeV/yh9kA3Pd9NOV0uvBntromN90sb9aiaaPGvLkaYVfUNU7O8bsgBgmvO/GMaao LFhN0mq06HHJtG4ZO2HKrb9Y35Kf+x8VSCBty7LmZAqDvWlAN+01q6+P9hsjnc/pS5 Pq3wCiWrVQU+WsT+gJQa+4fqc6bRKBuB/W6E6fP4MRcNNHIFPUEGqMjbyX03kniPRw HJqqoQZI6u1tjkjzwkx6c9yl/xRlmtD7bGpzoZYgJjaL2KuqMcAP4T7YW/T7wyRzf8 c1CeIPgNxz3WG9CfzPamEggWU3i9gd4RVaDmSPm20nO0AkFK7eBPZkDXhbFe8dLMsB LGD0yeHyDmw0g== From: Arnd Bergmann To: Zhang Rui , Daniel Lezcano , Matthias Brugger , Jean-Francois Dagenais Cc: Arnd Bergmann , Amit Kucheria , Lukasz Luba , Thara Gopinath , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] thermal: fix thermal_cooling_device_register() prototype Date: Thu, 22 Jul 2021 11:06:44 +0200 Message-Id: <20210722090717.1116748-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann There are two pairs of declarations for thermal_cooling_device_register() and thermal_of_cooling_device_register(), and only one set was changed in a recent patch, so the other one now causes a compile-time warning: drivers/net/wireless/mediatek/mt76/mt7915/init.c: In function 'mt7915_thermal_init': drivers/net/wireless/mediatek/mt76/mt7915/init.c:134:48: error: passing argument 1 of 'thermal_cooling_device_register' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 134 | cdev = thermal_cooling_device_register(wiphy_name(wiphy), phy, | ^~~~~~~~~~~~~~~~~ In file included from drivers/net/wireless/mediatek/mt76/mt7915/init.c:7: include/linux/thermal.h:407:39: note: expected 'char *' but argument is of type 'const char *' 407 | thermal_cooling_device_register(char *type, void *devdata, | ~~~~~~^~~~ Change the dummy helper functions to have the same arguments as the normal version. Fixes: f991de53a8ab ("thermal: make device_register's type argument const") Signed-off-by: Arnd Bergmann --- include/linux/thermal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index d296f3b88fb9..8050d929a5b4 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -404,12 +404,13 @@ static inline void thermal_zone_device_unregister( struct thermal_zone_device *tz) { } static inline struct thermal_cooling_device * -thermal_cooling_device_register(char *type, void *devdata, +thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } static inline struct thermal_cooling_device * thermal_of_cooling_device_register(struct device_node *np, - char *type, void *devdata, const struct thermal_cooling_device_ops *ops) + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } static inline struct thermal_cooling_device * devm_thermal_of_cooling_device_register(struct device *dev, -- 2.29.2