mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] hwmon: nzxt-smart2: make array detect_fans_report static const
@ 2022-01-09 19:45 Colin Ian King
  2022-01-10  1:11 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-01-09 19:45 UTC (permalink / raw)
  To: Aleksandr Mezin, Jean Delvare, Guenter Roeck, linux-hwmon
  Cc: kernel-janitors, linux-kernel

Don't populate the read-only array detect_fans_report on the stack but
instead it static const. Also makes the object code a little smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/hwmon/nzxt-smart2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c
index 6e67da766969..dd892ff5a3e8 100644
--- a/drivers/hwmon/nzxt-smart2.c
+++ b/drivers/hwmon/nzxt-smart2.c
@@ -583,7 +583,7 @@ static int set_update_interval(struct drvdata *drvdata, long val)
 static int init_device(struct drvdata *drvdata, long update_interval)
 {
 	int ret;
-	u8 detect_fans_report[] = {
+	static const u8 detect_fans_report[] = {
 		OUTPUT_REPORT_ID_INIT_COMMAND,
 		INIT_COMMAND_DETECT_FANS,
 	};
-- 
2.33.1


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

* Re: [PATCH][next] hwmon: nzxt-smart2: make array detect_fans_report static const
  2022-01-09 19:45 [PATCH][next] hwmon: nzxt-smart2: make array detect_fans_report static const Colin Ian King
@ 2022-01-10  1:11 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-01-10  1:11 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Aleksandr Mezin, Jean Delvare, linux-hwmon, kernel-janitors,
	linux-kernel

On Sun, Jan 09, 2022 at 07:45:58PM +0000, Colin Ian King wrote:
> Don't populate the read-only array detect_fans_report on the stack but
> instead it static const. Also makes the object code a little smaller.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/nzxt-smart2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c
> index 6e67da766969..dd892ff5a3e8 100644
> --- a/drivers/hwmon/nzxt-smart2.c
> +++ b/drivers/hwmon/nzxt-smart2.c
> @@ -583,7 +583,7 @@ static int set_update_interval(struct drvdata *drvdata, long val)
>  static int init_device(struct drvdata *drvdata, long update_interval)
>  {
>  	int ret;
> -	u8 detect_fans_report[] = {
> +	static const u8 detect_fans_report[] = {
>  		OUTPUT_REPORT_ID_INIT_COMMAND,
>  		INIT_COMMAND_DETECT_FANS,
>  	};

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

end of thread, other threads:[~2022-01-10  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-09 19:45 [PATCH][next] hwmon: nzxt-smart2: make array detect_fans_report static const Colin Ian King
2022-01-10  1:11 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome