From f540c42d9564854b19ce9bbb70affe172529fe70 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 19 Dec 2007 14:09:58 +0100 Subject: [PATCH] Fix building with CRAMFS but not JFFS2 support Signed-off-by: Harald Welte --- common/cmd_jffs2.c | 9 +++++++++ fs/cramfs/cramfs.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index efe9eb7be4c..1b67e73f111 100644 --- a/common/cmd_jffs2.c +++ b/common/cmd_jffs2.c @@ -167,10 +167,19 @@ struct list_head devices; static struct mtd_device *current_dev = NULL; static u8 current_partnum = 0; +#if defined(CONFIG_CMD_CRAMFS) extern int cramfs_check (struct part_info *info); extern int cramfs_load (char *loadoffset, struct part_info *info, char *filename); extern int cramfs_ls (struct part_info *info, char *filename); extern int cramfs_info (struct part_info *info); +#else +/* defining empty macros for function names is ugly but avoids ifdef clutter + * all over the code */ +#define cramfs_check(x) (0) +#define cramfs_load(x,y,z) (-1) +#define cramfs_ls(x,y) (0) +#define cramfs_info(x) (0) +#endif static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num); diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 369d1f16740..e53c783e5a4 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -27,7 +27,7 @@ #include #include -#if defined(CONFIG_CMD_JFFS2) +#if defined(CONFIG_CMD_CRAMFS) #include #include