From: "Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
To: Hugh Dickins <hughd@google.com>
Cc: linux-mm@kvack.org, "Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
Subject: [PATCH] shmem: fix compilation warnings on unused functions
Date: Fri, 18 Nov 2016 00:57:49 -0500 [thread overview]
Message-ID: <20161118055749.11313-1-jeremy.lefaure@lse.epita.fr> (raw)
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: a??shmem_format_hugea?? defined but not used
[-Wunused-function]
static const char *shmem_format_huge(int huge)
^~~~~~~~~~~~~~~~~
mm/shmem.c:373:12: warning: a??shmem_parse_hugea?? 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: JA(C)rA(C)my Lefaure <jeremy.lefaure@lse.epita.fr>
---
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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2016-11-18 5:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 5:57 Jérémy Lefaure [this message]
2016-11-18 23:38 ` Hugh Dickins
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=20161118055749.11313-1-jeremy.lefaure@lse.epita.fr \
--to=jeremy.lefaure@lse.epita.fr \
--cc=hughd@google.com \
--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