public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] HID: uclogic: make read-only array reconnect_event static const
@ 2025-06-19  8:34 Colin Ian King
  2025-06-20  7:06 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-06-19  8:34 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: kernel-janitors, linux-kernel

Don't populate the read-only array reconnect_event on the stack
at run time, instead make it static const.

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

diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
index a6044996abf2..b3d56057cec9 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -1341,7 +1341,7 @@ static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev,
 						   struct uclogic_params *p)
 {
 	struct uclogic_raw_event_hook *event_hook;
-	__u8 reconnect_event[] = {
+	static const __u8 reconnect_event[] = {
 		/* Event received on wireless tablet reconnection */
 		0x02, 0xF8, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 	};
-- 
2.49.0


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

* Re: [PATCH][next] HID: uclogic: make read-only array reconnect_event static const
  2025-06-19  8:34 [PATCH][next] HID: uclogic: make read-only array reconnect_event static const Colin Ian King
@ 2025-06-20  7:06 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2025-06-20  7:06 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Benjamin Tissoires, linux-input, kernel-janitors, linux-kernel

On Thu, 19 Jun 2025, Colin Ian King wrote:

> Don't populate the read-only array reconnect_event on the stack
> at run time, instead make it static const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/hid/hid-uclogic-params.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
> index a6044996abf2..b3d56057cec9 100644
> --- a/drivers/hid/hid-uclogic-params.c
> +++ b/drivers/hid/hid-uclogic-params.c
> @@ -1341,7 +1341,7 @@ static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev,
>  						   struct uclogic_params *p)
>  {
>  	struct uclogic_raw_event_hook *event_hook;
> -	__u8 reconnect_event[] = {
> +	static const __u8 reconnect_event[] = {
>  		/* Event received on wireless tablet reconnection */
>  		0x02, 0xF8, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

Good catch. Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2025-06-20  7:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19  8:34 [PATCH][next] HID: uclogic: make read-only array reconnect_event static const Colin Ian King
2025-06-20  7:06 ` Jiri Kosina

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