mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
Cc: shuah@kernel.org, surenb@google.com, skhan@linuxfoundation.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH] selftests: proc: mark vsyscall strings maybe-unused
Date: Wed, 20 Aug 2025 14:39:54 -0700	[thread overview]
Message-ID: <20250820143954.33d95635e504e94df01930d0@linux-foundation.org> (raw)
In-Reply-To: <20250820175610.83014-1-reddybalavignesh9979@gmail.com>

On Wed, 20 Aug 2025 23:26:10 +0530 Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com> wrote:

> The str_vsyscall_* constants in proc-pid-vm.c triggers
> -Wunused-const-variable warnings with gcc-13.32 and clang 18.1.

OT but lol.  My head is spinning at the term "const-variable".  I
understand what they mean, but it's oxymoronic.

> Define and apply __maybe_unused locally to suppress the warnings.
> No functional change
> 
> Fixes compiler warning:
> warning: ‘str_vsyscall_*’ defined but not used[-Wunused-const-variable]
>
> ...
>
> --- a/tools/testing/selftests/proc/proc-pid-vm.c
> +++ b/tools/testing/selftests/proc/proc-pid-vm.c
> @@ -47,6 +47,10 @@
>  #include <sys/resource.h>
>  #include <linux/fs.h>
>  
> +#ifndef __maybe_unused
> +#define __maybe_unused __attribute__((__unused__))
> +#endif

This would be approximately the seventh definition of __maybe_unused
under tools/testing/selftests.  And there's another in
tools/testing/memblock, which, as if admitting that its directory is in
the wrong place, had to go and include ../selftests/kselftest.h.

So it would be pleasing if some kind soul were to define __maybe_unused
in a common place, which looks to be
tools/testing/selftests/kselftest.h.  Then go zap all those private
definitions.

This could be done either before or after your patch.

>  #include "../kselftest.h"

And we have 350 occurrences of "../kselftest.h".  Shouldn't the build
system be providing -Itools/testing/selftests?

Anyway, patch looks OK - I'll add it to mm.git, thanks.

  reply	other threads:[~2025-08-20 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 17:56 Bala-Vignesh-Reddy
2025-08-20 21:39 ` Andrew Morton [this message]
2025-08-21 10:31   ` Bala-Vignesh-Reddy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250820143954.33d95635e504e94df01930d0@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=reddybalavignesh9979@gmail.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®