Skip to content

Commit f1f5929

Browse files
Jérémy Lefauretorvalds
authored andcommitted
shmem: fix compilation warnings on unused functions
Compiling shmem.c with SHMEM and 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. Link: http://lkml.kernel.org/r/20161118055749.11313-1-jeremy.lefaure@lse.epita.fr Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Acked-by: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent bace924 commit f1f5929

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎mm/shmem.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static bool shmem_confirm_swap(struct address_space *mapping,
370370

371371
int shmem_huge __read_mostly;
372372

373+
#if defined(CONFIG_SYSFS) || defined(CONFIG_TMPFS)
373374
static int shmem_parse_huge(const char *str)
374375
{
375376
if (!strcmp(str, "never"))
@@ -407,6 +408,7 @@ static const char *shmem_format_huge(int huge)
407408
return "bad_val";
408409
}
409410
}
411+
#endif
410412

411413
static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,
412414
struct shrink_control *sc, unsigned long nr_to_split)

0 commit comments

Comments
 (0)