Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ALSA: oxfw: make read-only const array models static
@ 2023-06-27 11:32 Colin Ian King
  2023-06-27 23:36 ` Takashi Sakamoto
  2023-06-28  9:42 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2023-06-27 11:32 UTC (permalink / raw)
  To: Clemens Ladisch, Jaroslav Kysela, Takashi Iwai, alsa-devel
  Cc: kernel-janitors, linux-kernel

Don't populate the const array on the stack, instead make it static.

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

diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 9523479fa94a..63d40f1a914f 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -44,7 +44,7 @@ struct compat_info {
 
 static bool detect_loud_models(struct fw_unit *unit)
 {
-	const char *const models[] = {
+	static const char *const models[] = {
 		"Onyxi",
 		"Onyx-i",
 		"Onyx 1640i",
-- 
2.39.2


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

* Re: [PATCH][next] ALSA: oxfw: make read-only const array models static
  2023-06-27 11:32 [PATCH][next] ALSA: oxfw: make read-only const array models static Colin Ian King
@ 2023-06-27 23:36 ` Takashi Sakamoto
  2023-06-28  9:42 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Sakamoto @ 2023-06-27 23:36 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Clemens Ladisch, Jaroslav Kysela, Takashi Iwai, alsa-devel,
	kernel-janitors, linux-kernel

Hi,

On Tue, Jun 27, 2023 at 12:32:53PM +0100, Colin Ian King wrote:
> Don't populate the const array on the stack, instead make it static.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  sound/firewire/oxfw/oxfw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
> index 9523479fa94a..63d40f1a914f 100644
> --- a/sound/firewire/oxfw/oxfw.c
> +++ b/sound/firewire/oxfw/oxfw.c
> @@ -44,7 +44,7 @@ struct compat_info {
>  
>  static bool detect_loud_models(struct fw_unit *unit)
>  {
> -	const char *const models[] = {
> +	static const char *const models[] = {
>  		"Onyxi",
>  		"Onyx-i",
>  		"Onyx 1640i",
> -- 
> 2.39.2
 
Indeed. It is preferable.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

I found that ALSA fireface driver includes the similar issue. I'll send a
patch to fix it later.


Thanks

Takashi Sakamoto

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

* Re: [PATCH][next] ALSA: oxfw: make read-only const array models static
  2023-06-27 11:32 [PATCH][next] ALSA: oxfw: make read-only const array models static Colin Ian King
  2023-06-27 23:36 ` Takashi Sakamoto
@ 2023-06-28  9:42 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2023-06-28  9:42 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Clemens Ladisch, Jaroslav Kysela, Takashi Iwai, alsa-devel,
	kernel-janitors, linux-kernel

On Tue, 27 Jun 2023 13:32:53 +0200,
Colin Ian King wrote:
> 
> Don't populate the const array on the stack, instead make it static.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Thanks, applied.


Takashi

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

end of thread, other threads:[~2023-06-28  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27 11:32 [PATCH][next] ALSA: oxfw: make read-only const array models static Colin Ian King
2023-06-27 23:36 ` Takashi Sakamoto
2023-06-28  9:42 ` Takashi Iwai

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