[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87il042mbn.wl-tiwai@suse.de>
Date: Fri, 26 Apr 2024 17:08:44 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Ivan Orlov <ivan.orlov0322@...il.com>
Cc: Takashi Sakamoto <o-takashi@...amocchi.jp>,
Colin Ian King <colin.i.king@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
linux-sound@...r.kernel.org,
kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] ALSA: kunit: make read-only array buf_samples static const
On Fri, 26 Apr 2024 14:05:34 +0200,
Ivan Orlov wrote:
>
> On 4/26/24 00:22, Takashi Sakamoto wrote:
> > 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@...il.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@...amocchi.jp>
> >
> > We can see the other similar cases in the kunit file. I'll post the fix
> > later.
> >
>
> Hi Takashi,
>
> Hmm, correct me if I'm wrong, but I don't see any other significant
> allocations on the stack in the test.
I guess he meant slightly different ones
https://lore.kernel.org/r/20240425233653.218434-1-o-takashi@sakamocchi.jp
Takashi
Powered by blists - more mailing lists