* [PATCH v1] selftests: cachestat: Fix warning on declaration under label
@ 2025-09-29 11:54 Sidharth Seela
2025-09-29 17:27 ` SeongJae Park
2025-09-30 4:52 ` Dev Jain
0 siblings, 2 replies; 8+ messages in thread
From: Sidharth Seela @ 2025-09-29 11:54 UTC (permalink / raw)
To: nphamcs, hannes, nathan, shuah, morbo, justinstitt,
nick.desaulniers+lkml
Cc: linux-mm, linux-kselftest, linux-kernel, llvm,
david.hunter.linux, Sidharth Seela
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@gmail.com>
---
diff --git a/tools/testing/selftests/cachestat/test_cachestat.c b/tools/testing/selftests/cachestat/test_cachestat.c
index c952640f163b..0305e736f2b8 100644
--- a/tools/testing/selftests/cachestat/test_cachestat.c
+++ b/tools/testing/selftests/cachestat/test_cachestat.c
@@ -226,7 +226,7 @@ bool run_cachestat_test(enum file_type type)
int syscall_ret;
size_t compute_len = PS * 512;
struct cachestat_range cs_range = { PS, compute_len };
- char *filename = "tmpshmcstat";
+ char *filename = "tmpshmcstat", *map;
struct cachestat cs;
bool ret = true;
int fd;
@@ -257,7 +257,7 @@ bool run_cachestat_test(enum file_type type)
}
break;
case FILE_MMAP:
- char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE,
+ map = mmap(NULL, filesize, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
if (map == MAP_FAILED) {
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-09-29 11:54 [PATCH v1] selftests: cachestat: Fix warning on declaration under label Sidharth Seela
@ 2025-09-29 17:27 ` SeongJae Park
2025-09-30 3:31 ` lianux
2025-10-10 20:07 ` Shuah Khan
2025-09-30 4:52 ` Dev Jain
1 sibling, 2 replies; 8+ messages in thread
From: SeongJae Park @ 2025-09-29 17:27 UTC (permalink / raw)
To: Sidharth Seela
Cc: SeongJae Park, nphamcs, hannes, nathan, shuah, morbo,
justinstitt, nick.desaulniers+lkml, linux-mm, linux-kselftest,
linux-kernel, llvm, david.hunter.linux
On Mon, 29 Sep 2025 17:24:06 +0530 Sidharth Seela <sidharthseela@gmail.com> 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@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-09-29 17:27 ` SeongJae Park
@ 2025-09-30 3:31 ` lianux
2025-10-10 20:07 ` Shuah Khan
1 sibling, 0 replies; 8+ messages in thread
From: lianux @ 2025-09-30 3:31 UTC (permalink / raw)
To: sj
Cc: david.hunter.linux, hannes, justinstitt, linux-kernel,
linux-kselftest, linux-mm, llvm, morbo, nathan,
nick.desaulniers+lkml, nphamcs, shuah, sidharthseela, wang lian
From: wang lian <lianux.mm@gmail.com>
Reviewed-by: wang lian <lianux.mm@gmail.com>
> 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@gmail.com>
Best regards,
wang lian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-09-29 11:54 [PATCH v1] selftests: cachestat: Fix warning on declaration under label Sidharth Seela
2025-09-29 17:27 ` SeongJae Park
@ 2025-09-30 4:52 ` Dev Jain
2025-10-22 15:27 ` Shuah Khan
1 sibling, 1 reply; 8+ messages in thread
From: Dev Jain @ 2025-09-30 4:52 UTC (permalink / raw)
To: Sidharth Seela, nphamcs, hannes, nathan, shuah, morbo,
justinstitt, nick.desaulniers+lkml
Cc: linux-mm, linux-kselftest, linux-kernel, llvm, david.hunter.linux
On 29/09/25 5:24 pm, Sidharth Seela 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@gmail.com>
> ---
>
Reviewed-by: Dev Jain <dev.jain@arm.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-09-29 17:27 ` SeongJae Park
2025-09-30 3:31 ` lianux
@ 2025-10-10 20:07 ` Shuah Khan
2025-10-20 17:13 ` Nhat Pham
1 sibling, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2025-10-10 20:07 UTC (permalink / raw)
To: hannes, nphamcs
Cc: nathan, shuah, morbo, justinstitt, nick.desaulniers+lkml,
linux-mm, linux-kselftest, linux-kernel, llvm,
david.hunter.linux, Shuah Khan, Sidharth Seela, SeongJae Park
On 9/29/25 11:27, SeongJae Park wrote:
> On Mon, 29 Sep 2025 17:24:06 +0530 Sidharth Seela <sidharthseela@gmail.com> 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@gmail.com>
>
> Reviewed-by: SeongJae Park <sj@kernel.org>
>
>
Johannes and Nhat,
Assuming this will go through cachestat tree
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Let me know if you would like me to take this through my tree.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-10-10 20:07 ` Shuah Khan
@ 2025-10-20 17:13 ` Nhat Pham
0 siblings, 0 replies; 8+ messages in thread
From: Nhat Pham @ 2025-10-20 17:13 UTC (permalink / raw)
To: Shuah Khan
Cc: hannes, nathan, shuah, morbo, justinstitt, nick.desaulniers+lkml,
linux-mm, linux-kselftest, linux-kernel, llvm,
david.hunter.linux, Sidharth Seela, SeongJae Park
On Fri, Oct 10, 2025 at 1:07 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 9/29/25 11:27, SeongJae Park wrote:
> > On Mon, 29 Sep 2025 17:24:06 +0530 Sidharth Seela <sidharthseela@gmail.com> 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@gmail.com>
> >
> > Reviewed-by: SeongJae Park <sj@kernel.org>
> >
> >
>
> Johannes and Nhat,
>
> Assuming this will go through cachestat tree
>
> Acked-by: Shuah Khan <skhan@linuxfoundation.org>
>
Hi Shuah.
LGTM:
Acked-by: Nhat Pham <nphamcs@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-09-30 4:52 ` Dev Jain
@ 2025-10-22 15:27 ` Shuah Khan
2025-10-23 15:04 ` Sidharth Seela
0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2025-10-22 15:27 UTC (permalink / raw)
To: Dev Jain, Sidharth Seela, nphamcs, hannes, nathan, shuah, morbo,
justinstitt, nick.desaulniers+lkml
Cc: linux-mm, linux-kselftest, linux-kernel, llvm,
david.hunter.linux, Shuah Khan
On 9/29/25 22:52, Dev Jain wrote:
>
> On 29/09/25 5:24 pm, Sidharth Seela 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:
>> --
Sidharth,
Make sure to not use "---" in your commit logs. Everything after
this line gets thrown away. I had to go fix it manually.
>> -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@gmail.com>
>> ---
>>
>
> Reviewed-by: Dev Jain <dev.jain@arm.com>
>
Applied to linux-kselftest fixes branch for next rc.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] selftests: cachestat: Fix warning on declaration under label
2025-10-22 15:27 ` Shuah Khan
@ 2025-10-23 15:04 ` Sidharth Seela
0 siblings, 0 replies; 8+ messages in thread
From: Sidharth Seela @ 2025-10-23 15:04 UTC (permalink / raw)
To: Shuah Khan
Cc: Dev Jain, nphamcs, hannes, nathan, shuah, morbo, justinstitt,
nick.desaulniers+lkml, linux-mm, linux-kselftest, linux-kernel,
llvm, david.hunter.linux
> Make sure to not use "---" in your commit logs. Everything after
> this line gets thrown away. I had to go fix it manually.
Sorry, I will make sure that doesn't happen again.
--
Thanks,
Sidharth Seela
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-10-23 15:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-29 11:54 [PATCH v1] selftests: cachestat: Fix warning on declaration under label Sidharth Seela
2025-09-29 17:27 ` SeongJae Park
2025-09-30 3:31 ` lianux
2025-10-10 20:07 ` Shuah Khan
2025-10-20 17:13 ` Nhat Pham
2025-09-30 4:52 ` Dev Jain
2025-10-22 15:27 ` Shuah Khan
2025-10-23 15:04 ` Sidharth Seela
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox