[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220504184537.130085-1-sj@kernel.org>
Date: Wed, 4 May 2022 18:45:37 +0000
From: SeongJae Park <sj@...nel.org>
To: Yuanchu Xie <yuanchu@...gle.com>
Cc: Shuah Khan <shuah@...nel.org>, Markus Boehme <markubo@...zon.de>,
SeongJae Park <sj@...nel.org>, rientjes@...gle.com,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write
Hi Yuanchu,
On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie <yuanchu@...gle.com> wrote:
> The test case added in commit db7a347b26fe ("mm/damon/dbgfs:
> use '__GFP_NOWARN' for user-specified size buffer allocation")
> intentionally writes and reads with a large count to cause
> allocation failure and check for kernel warnings. We suppress
> the compiler warnings for these calls as they work as intended.
>
> Signed-off-by: Yuanchu Xie <yuanchu@...gle.com>
> ---
It would be a good practice to mention the changes from the previous version of
this patch here[1].
[1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format
> tools/testing/selftests/damon/huge_count_read_write.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c
> index ad7a6b4cf338..91bd80c75cd9 100644
> --- a/tools/testing/selftests/damon/huge_count_read_write.c
> +++ b/tools/testing/selftests/damon/huge_count_read_write.c
> @@ -2,6 +2,8 @@
> /*
> * Author: SeongJae Park <sj@...nel.org>
> */
> +#pragma GCC diagnostic ignored "-Wstringop-overflow"
> +#pragma GCC diagnostic ignored "-Wstringop-overread"
I agree that this must be the cleaner way than v2. But, I get below warning
after applying this:
$ sudo make -C tools/testing/selftests/damon run_tests
make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon'
gcc huge_count_read_write.c -o /home/sjpark/linux/tools/testing/selftests/damon/huge_count_read_write
huge_count_read_write.c:6:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
6 | #pragma GCC diagnostic ignored "-Wstringop-overread"
| ^~~~~~~~~~~~~~~~~~~~~
My gcc version is:
$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Thanks,
SJ
>
> #include <fcntl.h>
> #include <stdlib.h>
> --
> 2.36.0.464.gb9c8b46e94-goog
>
Powered by blists - more mailing lists