Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label

From: Nhat Pham

Date: Mon Oct 20 2025 - 13:13:20 EST


On Fri, Oct 10, 2025 at 1:07 PM Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On 9/29/25 11:27, SeongJae Park wrote:
> > On Mon, 29 Sep 2025 17:24:06 +0530 Sidharth Seela <sidharthseela@xxxxxxxxx> wrote:
> >
> >> Fix warning caused from declaration under a case label. The proper way
> >> is to declare variable at the beginning of the function. The warning
> >> came from running clang using LLVM=1; and is as follows:
> >> --
> >> -test_cachestat.c:260:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
> >> 260 | char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE,
> >> |
> >>
> >> Signed-off-by: Sidharth Seela <sidharthseela@xxxxxxxxx>
> >
> > Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>
> >
> >
>
> Johannes and Nhat,
>
> Assuming this will go through cachestat tree
>
> Acked-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
>

Hi Shuah.

LGTM:
Acked-by: Nhat Pham <nphamcs@xxxxxxxxx>