From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH 12 of 18] tools/memshr: fix build errors caused by Werror Date: Mon, 02 Apr 2012 22:15:35 +0200 Message-ID: <5d89ebdf878b8b0647a6.1333397735@probook.site> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Olaf Hering # Date 1333397566 -7200 # Node ID 5d89ebdf878b8b0647a688d0ef938bb933772d86 # Parent c582ef14a24cb2186c1748047a62a85fae0dbeb3 tools/memshr: fix build errors caused by Werror -O2 -Wall -Werror triggers these warnings: cc1: warnings being treated as errors interface.c: In function 'memshr_daemon_initialize': interface.c:55: error: unused variable 'h' interface.c:54: error: unused variable 'shm_base_addr' cc1: warnings being treated as errors bidir-hash.h:47: error: 'fgprtshr_fgprt_hash' defined but not used bidir-hash.h:52: error: 'fgprtshr_mfn_hash' defined but not used bidir-hash.h:57: error: 'fgprtshr_fgprt_cmp' defined but not used bidir-hash.h:62: error: 'fgprtshr_mfn_cmp' defined but not used make[3]: *** [interface.o] Error 1 make[3]: *** [bidir-daemon.o] Error 1 cc1: warnings being treated as errors bidir-hash.h:47: error: 'fgprtshr_fgprt_hash' defined but not used bidir-hash.h:52: error: 'fgprtshr_mfn_hash' defined but not used bidir-hash.h:57: error: 'fgprtshr_fgprt_cmp' defined but not used bidir-hash.h:62: error: 'fgprtshr_mfn_cmp' defined but not used Mark fingerprint functions as inline, remove unused variables. Signed-off-by: Olaf Hering Acked-by: Ian Jackson diff -r c582ef14a24c -r 5d89ebdf878b tools/memshr/bidir-hash.h --- a/tools/memshr/bidir-hash.h +++ b/tools/memshr/bidir-hash.h @@ -43,22 +43,22 @@ typedef struct vbdblk { #undef BIDIR_VALUE #undef BIDIR_KEY_T #undef BIDIR_VALUE_T -static uint32_t fgprtshr_fgprt_hash(uint32_t h) +static inline uint32_t fgprtshr_fgprt_hash(uint32_t h) { return h; } -static uint32_t fgprtshr_mfn_hash(uint64_t m) +static inline uint32_t fgprtshr_mfn_hash(uint64_t m) { return (uint32_t)m; } -static int fgprtshr_fgprt_cmp(uint32_t h1, uint32_t h2) +static inline int fgprtshr_fgprt_cmp(uint32_t h1, uint32_t h2) { return (h1 == h2); } -static int fgprtshr_mfn_cmp(uint32_t m1, uint32_t m2) +static inline int fgprtshr_mfn_cmp(uint32_t m1, uint32_t m2) { return (m1 == m2); } diff -r c582ef14a24c -r 5d89ebdf878b tools/memshr/interface.c --- a/tools/memshr/interface.c +++ b/tools/memshr/interface.c @@ -51,9 +51,6 @@ void memshr_set_domid(int domid) void memshr_daemon_initialize(void) { - void *shm_base_addr; - struct fgprtshr_hash *h; - memset(&memshr, 0, sizeof(private_memshr_info_t)); if((SHARED_INFO = shm_shared_info_open(1)) == NULL)