From: Hugh Dickins <hughd@google.com>
To: Jeremy Lefaure <jeremy.lefaure@lse.epita.fr>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org
Subject: Re: [PATCH] shmem: fix compilation warnings on unused functions
Date: Fri, 18 Nov 2016 15:38:25 -0800 (PST) [thread overview]
Message-ID: <alpine.LSU.2.11.1611181536170.11302@eggly.anvils> (raw)
In-Reply-To: <20161118055749.11313-1-jeremy.lefaure@lse.epita.fr>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1538 bytes --]
On Fri, 18 Nov 2016, Jeremy Lefaure wrote:
> Compiling shmem.c with CONFIG_SHMEM and
> CONFIG_TRANSAPRENT_HUGE_PAGECACHE enabled raises warnings on two unused
> functions when CONFIG_TMPFS and CONFIG_SYSFS are both disabled:
>
> mm/shmem.c:390:20: warning: ‘shmem_format_huge’ defined but not used
> [-Wunused-function]
> static const char *shmem_format_huge(int huge)
> ^~~~~~~~~~~~~~~~~
> mm/shmem.c:373:12: warning: ‘shmem_parse_huge’ defined but not used
> [-Wunused-function]
> static int shmem_parse_huge(const char *str)
> ^~~~~~~~~~~~~~~~
>
> A conditional compilation on tmpfs or sysfs removes the warnings.
>
> Signed-off-by: Jeremy Lefaure <jeremy.lefaure@lse.epita.fr>
Acked-by: Hugh Dickins <hughd@google.com>
Thank you!
> ---
> mm/shmem.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 2c74186..99595d8 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -370,6 +370,7 @@ static bool shmem_confirm_swap(struct address_space *mapping,
>
> int shmem_huge __read_mostly;
>
> +#if defined(CONFIG_SYSFS) || defined(CONFIG_TMPFS)
> static int shmem_parse_huge(const char *str)
> {
> if (!strcmp(str, "never"))
> @@ -407,6 +408,7 @@ static const char *shmem_format_huge(int huge)
> return "bad_val";
> }
> }
> +#endif
>
> static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,
> struct shrink_control *sc, unsigned long nr_to_split)
> --
> 2.10.2
prev parent reply other threads:[~2016-11-18 23:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 5:57 [PATCH] shmem: fix compilation warnings on unused functions Jérémy Lefaure
2016-11-18 23:38 ` Hugh Dickins [this message]
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=alpine.LSU.2.11.1611181536170.11302@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=jeremy.lefaure@lse.epita.fr \
--cc=linux-mm@kvack.org \
/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;
as well as URLs for NNTP newsgroup(s).