platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info
@ 2023-04-07 15:03 Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 2/4] platform/x86: hp: " Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Thomas Weißschuh, Hans de Goede, Mark Gross, Jeremy Soller,
	System76 Product Development, Azael Avalos, platform-driver-x86,
	linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/platform/x86/gigabyte-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/gigabyte-wmi.c b/drivers/platform/x86/gigabyte-wmi.c
index 5e5b17c50eb6..7cc969fb1beb 100644
--- a/drivers/platform/x86/gigabyte-wmi.c
+++ b/drivers/platform/x86/gigabyte-wmi.c
@@ -99,7 +99,7 @@ static umode_t gigabyte_wmi_hwmon_is_visible(const void *data, enum hwmon_sensor
 	return usable_sensors_mask & BIT(channel) ? 0444  : 0;
 }
 
-static const struct hwmon_channel_info *gigabyte_wmi_hwmon_info[] = {
+static const struct hwmon_channel_info * const gigabyte_wmi_hwmon_info[] = {
 	HWMON_CHANNEL_INFO(temp,
 			   HWMON_T_INPUT,
 			   HWMON_T_INPUT,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] platform/x86: hp: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info Krzysztof Kozlowski
@ 2023-04-07 15:03 ` Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 3/4] platform/x86: system76: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Thomas Weißschuh, Hans de Goede, Mark Gross, Jeremy Soller,
	System76 Product Development, Azael Avalos, platform-driver-x86,
	linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/platform/x86/hp/hp-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 873f59c3e280..7b6b1d089d72 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -1482,7 +1482,7 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
 	}
 }
 
-static const struct hwmon_channel_info *info[] = {
+static const struct hwmon_channel_info * const info[] = {
 	HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT, HWMON_F_INPUT),
 	HWMON_CHANNEL_INFO(pwm, HWMON_PWM_ENABLE),
 	NULL
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] platform/x86: system76: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 2/4] platform/x86: hp: " Krzysztof Kozlowski
@ 2023-04-07 15:03 ` Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 4/4] platform/x86: toshiba: " Krzysztof Kozlowski
  2023-04-11  8:31 ` [PATCH 1/4] platform/x86: gigabyte: " Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Thomas Weißschuh, Hans de Goede, Mark Gross, Jeremy Soller,
	System76 Product Development, Azael Avalos, platform-driver-x86,
	linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/platform/x86/system76_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/system76_acpi.c b/drivers/platform/x86/system76_acpi.c
index 97f5a8255b91..fc4708fa6ebe 100644
--- a/drivers/platform/x86/system76_acpi.c
+++ b/drivers/platform/x86/system76_acpi.c
@@ -581,7 +581,7 @@ static const struct hwmon_ops thermal_ops = {
 };
 
 // Allocate up to 8 fans and temperatures
-static const struct hwmon_channel_info *thermal_channel_info[] = {
+static const struct hwmon_channel_info * const thermal_channel_info[] = {
 	HWMON_CHANNEL_INFO(fan,
 		HWMON_F_INPUT | HWMON_F_LABEL,
 		HWMON_F_INPUT | HWMON_F_LABEL,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] platform/x86: toshiba: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 2/4] platform/x86: hp: " Krzysztof Kozlowski
  2023-04-07 15:03 ` [PATCH 3/4] platform/x86: system76: " Krzysztof Kozlowski
@ 2023-04-07 15:03 ` Krzysztof Kozlowski
  2023-04-11  8:31 ` [PATCH 1/4] platform/x86: gigabyte: " Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 15:03 UTC (permalink / raw)
  To: Thomas Weißschuh, Hans de Goede, Mark Gross, Jeremy Soller,
	System76 Product Development, Azael Avalos, platform-driver-x86,
	linux-kernel
  Cc: Krzysztof Kozlowski, Jean Delvare, Guenter Roeck, linux-hwmon

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/

Therefore I propose this should also go via hwmon tree.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
 drivers/platform/x86/toshiba_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index b34984bbee33..291f14ef6702 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -3037,7 +3037,7 @@ static int toshiba_acpi_hwmon_read(struct device *dev, enum hwmon_sensor_types t
 	return -EOPNOTSUPP;
 }
 
-static const struct hwmon_channel_info *toshiba_acpi_hwmon_info[] = {
+static const struct hwmon_channel_info * const toshiba_acpi_hwmon_info[] = {
 	HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT),
 	NULL
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info
  2023-04-07 15:03 [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-04-07 15:03 ` [PATCH 4/4] platform/x86: toshiba: " Krzysztof Kozlowski
@ 2023-04-11  8:31 ` Hans de Goede
  3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2023-04-11  8:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thomas Weißschuh, Mark Gross,
	Jeremy Soller, System76 Product Development, Azael Avalos,
	platform-driver-x86, linux-kernel
  Cc: Jean Delvare, Guenter Roeck, linux-hwmon

Hi,

On 4/7/23 17:03, Krzysztof Kozlowski wrote:
> Statically allocated array of pointed to hwmon_channel_info can be made
> const for safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> This depends on hwmon core patch:
> https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/
> 
> Therefore I propose this should also go via hwmon tree.

Ok, taking all 4 these patches upstream through the hwmon tree
is fine by me, here is my Ack for that:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


p.s.

I'm going to drop these from my patch queue now. If for some
reason merging these through the hwmon tree does not work out,
please resend them after 6.4-rc1 is out (assuming that will
have the pre-requisite patch) and then I'll apply them directly.





> 
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-hwmon@vger.kernel.org
> ---
>  drivers/platform/x86/gigabyte-wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/gigabyte-wmi.c b/drivers/platform/x86/gigabyte-wmi.c
> index 5e5b17c50eb6..7cc969fb1beb 100644
> --- a/drivers/platform/x86/gigabyte-wmi.c
> +++ b/drivers/platform/x86/gigabyte-wmi.c
> @@ -99,7 +99,7 @@ static umode_t gigabyte_wmi_hwmon_is_visible(const void *data, enum hwmon_sensor
>  	return usable_sensors_mask & BIT(channel) ? 0444  : 0;
>  }
>  
> -static const struct hwmon_channel_info *gigabyte_wmi_hwmon_info[] = {
> +static const struct hwmon_channel_info * const gigabyte_wmi_hwmon_info[] = {
>  	HWMON_CHANNEL_INFO(temp,
>  			   HWMON_T_INPUT,
>  			   HWMON_T_INPUT,


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-11  8:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-07 15:03 [PATCH 1/4] platform/x86: gigabyte: constify pointers to hwmon_channel_info Krzysztof Kozlowski
2023-04-07 15:03 ` [PATCH 2/4] platform/x86: hp: " Krzysztof Kozlowski
2023-04-07 15:03 ` [PATCH 3/4] platform/x86: system76: " Krzysztof Kozlowski
2023-04-07 15:03 ` [PATCH 4/4] platform/x86: toshiba: " Krzysztof Kozlowski
2023-04-11  8:31 ` [PATCH 1/4] platform/x86: gigabyte: " Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).