linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: dlink-dir685-touchkeys: Make array bl_data static const
@ 2022-10-05 15:48 Colin Ian King
  2022-10-06  7:44 ` Mattijs Korpershoek
  2022-10-06  9:22 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2022-10-05 15:48 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov, linux-input; +Cc: kernel-janitors, linux-kernel

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

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/input/keyboard/dlink-dir685-touchkeys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/dlink-dir685-touchkeys.c b/drivers/input/keyboard/dlink-dir685-touchkeys.c
index a69dcc3bd30c..7db7fb175869 100644
--- a/drivers/input/keyboard/dlink-dir685-touchkeys.c
+++ b/drivers/input/keyboard/dlink-dir685-touchkeys.c
@@ -64,7 +64,7 @@ static int dir685_tk_probe(struct i2c_client *client,
 {
 	struct dir685_touchkeys *tk;
 	struct device *dev = &client->dev;
-	u8 bl_data[] = { 0xa7, 0x40 };
+	static const u8 bl_data[] = { 0xa7, 0x40 };
 	int err;
 	int i;
 
-- 
2.37.3


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

* Re: [PATCH] Input: dlink-dir685-touchkeys: Make array bl_data static const
  2022-10-05 15:48 [PATCH] Input: dlink-dir685-touchkeys: Make array bl_data static const Colin Ian King
@ 2022-10-06  7:44 ` Mattijs Korpershoek
  2022-10-06  9:22 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Mattijs Korpershoek @ 2022-10-06  7:44 UTC (permalink / raw)
  To: Colin Ian King, Linus Walleij, Dmitry Torokhov, linux-input
  Cc: kernel-janitors, linux-kernel

On Wed, Oct 05, 2022 at 16:48, Colin Ian King <colin.i.king@gmail.com> wrote:

> Don't populate the read-only array bl_data on the stack but instead
> make it static const. Also makes the object code a little smaller.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/keyboard/dlink-dir685-touchkeys.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/dlink-dir685-touchkeys.c b/drivers/input/keyboard/dlink-dir685-touchkeys.c
> index a69dcc3bd30c..7db7fb175869 100644
> --- a/drivers/input/keyboard/dlink-dir685-touchkeys.c
> +++ b/drivers/input/keyboard/dlink-dir685-touchkeys.c
> @@ -64,7 +64,7 @@ static int dir685_tk_probe(struct i2c_client *client,
>  {
>  	struct dir685_touchkeys *tk;
>  	struct device *dev = &client->dev;
> -	u8 bl_data[] = { 0xa7, 0x40 };
> +	static const u8 bl_data[] = { 0xa7, 0x40 };
>  	int err;
>  	int i;
>  
> -- 
> 2.37.3

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

* Re: [PATCH] Input: dlink-dir685-touchkeys: Make array bl_data static const
  2022-10-05 15:48 [PATCH] Input: dlink-dir685-touchkeys: Make array bl_data static const Colin Ian King
  2022-10-06  7:44 ` Mattijs Korpershoek
@ 2022-10-06  9:22 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-10-06  9:22 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Dmitry Torokhov, linux-input, kernel-janitors, linux-kernel

On Wed, Oct 5, 2022 at 5:48 PM Colin Ian King <colin.i.king@gmail.com> wrote:

> Don't populate the read-only array bl_data on the stack but instead
> make it static const. Also makes the object code a little smaller.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2022-10-06  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 15:48 [PATCH] Input: dlink-dir685-touchkeys: Make array bl_data static const Colin Ian King
2022-10-06  7:44 ` Mattijs Korpershoek
2022-10-06  9:22 ` Linus Walleij

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).