lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next] ALSA: kunit: make read-only array buf_samples static const
Hi,

On Thu, Apr 25, 2024 at 05:07:54PM +0100, Colin Ian King wrote:
> Don't populate the read-only array buf_samples on the stack at
> run time, instead make it static const.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> sound/core/sound_kunit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/core/sound_kunit.c b/sound/core/sound_kunit.c
> index eb90f62228c0..e34c4317f5eb 100644
> --- a/sound/core/sound_kunit.c
> +++ b/sound/core/sound_kunit.c
> @@ -167,7 +167,7 @@ static void _test_fill_silence(struct kunit *test, struct snd_format_test_data *
>
> static void test_format_fill_silence(struct kunit *test)
> {
> - u32 buf_samples[] = { 10, 20, 32, 64, 129, SILENCE_BUFFER_MAX_FRAMES };
> + static const u32 buf_samples[] = { 10, 20, 32, 64, 129, SILENCE_BUFFER_MAX_FRAMES };
> u8 *buffer;
> u32 i, j;

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

We can see the other similar cases in the kunit file. I'll post the fix
later.


Thanks

Takashi Sakamoto

\
 
 \ /
  Last update: 2024-05-27 18:04    [W:0.067 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site