From e918d9035fc505cb72b15403c90c2ae08354d4dd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 30 Mar 2017 00:00:35 +0200 Subject: [PATCH] compiler: Make ubi/ubifs compile with its unused variables Not sure why these were missing but they are very much needed to compile the ubi code. Fixes: | drivers/mtd/ubi/attach.c:808:2: warning: parameter names (without types) in function declaration | long long uninitialized_var(ec); | ^~~~ | drivers/mtd/ubi/attach.c:847:3: error: 'ec' undeclared (first use in this function) | ec = UBI_UNKNOWN; | ^~ --- include/linux/compiler-gcc5.h | 6 ++++++ include/linux/compiler-gcc6.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h index c8c565952..ff82ff424 100644 --- a/include/linux/compiler-gcc5.h +++ b/include/linux/compiler-gcc5.h @@ -63,3 +63,9 @@ #define __HAVE_BUILTIN_BSWAP64__ #define __HAVE_BUILTIN_BSWAP16__ #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h index c8c565952..ff82ff424 100644 --- a/include/linux/compiler-gcc6.h +++ b/include/linux/compiler-gcc6.h @@ -63,3 +63,9 @@ #define __HAVE_BUILTIN_BSWAP64__ #define __HAVE_BUILTIN_BSWAP16__ #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x