From 857874862ddffa816593e8d1c1f65587ca226bb7 Mon Sep 17 00:00:00 2001 From: girish Date: Thu, 17 Jul 2008 17:35:08 +0000 Subject: [PATCH] Cleanup Compiler Warnings(Patch by Robert Read) b=15981 i=adilger i=girish --- lustre/include/liblustre.h | 2 +- lustre/include/lustre_mdc.h | 2 +- lustre/liblustre/tests/test_common.c | 4 ++++ lustre/llite/dir.c | 4 ++-- lustre/mdd/mdd_object.c | 4 ++-- lustre/mdt/mdt_recovery.c | 18 +++++++++--------- lustre/obdclass/capa.c | 2 +- lustre/ptlrpc/sec_bulk.c | 2 +- lustre/utils/libiam.c | 6 +++--- 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 79ffd50..c7a4fcb 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -592,7 +592,7 @@ static inline int capable(int cap) .sleepers = CFS_LIST_HEAD_INIT(HEAD.sleepers) \ } #define init_waitqueue_head(l) CFS_INIT_LIST_HEAD(&(l)->sleepers) -#define wake_up(l) do { int a; a++; } while (0) +#define wake_up(l) do { } while (0) #define TASK_INTERRUPTIBLE 0 #define TASK_UNINTERRUPTIBLE 1 #define TASK_RUNNING 2 diff --git a/lustre/include/lustre_mdc.h b/lustre/include/lustre_mdc.h index 9a9a02a..c71b03f 100644 --- a/lustre/include/lustre_mdc.h +++ b/lustre/include/lustre_mdc.h @@ -73,7 +73,7 @@ static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck, struct mdc_cache_waiter { struct list_head mcw_entry; - wait_queue_head_t mcw_waitq; + cfs_waitq_t mcw_waitq; }; /* mdc/mdc_locks.c */ diff --git a/lustre/liblustre/tests/test_common.c b/lustre/liblustre/tests/test_common.c index 8b7ba3b..3bfffd2 100644 --- a/lustre/liblustre/tests/test_common.c +++ b/lustre/liblustre/tests/test_common.c @@ -24,6 +24,10 @@ int exit_on_err = 1; * util functions ******************************************************************/ +#ifdef EXIT +#undef EXIT +#endif + #define EXIT(err) \ do { \ if (exit_on_err) \ diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index b854067..5189f2f 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -261,8 +261,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash, int exact, struct page *page; ldlm_mode_t mode; int rc; - __u64 start; - __u64 end; + __u64 start = 0; + __u64 end = 0; mode = LCK_PR; rc = md_lock_match(ll_i2sbi(dir)->ll_md_exp, LDLM_FL_BLOCK_GRANTED, diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index ca302fb..eacbd6d 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -1455,12 +1455,12 @@ static int __mdd_readpage(const struct lu_env *env, struct mdd_object *obj, struct dt_object *next = mdd_object_child(obj); struct dt_it_ops *iops; struct page *pg; - struct lu_dirent *last; + struct lu_dirent *last = NULL; int i; int rc; int nob; __u64 hash_start; - __u64 hash_end; + __u64 hash_end = 0; LASSERT(rdpg->rp_pages != NULL); LASSERT(next->do_index_ops != NULL); diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 131a4f2..3a6ab9f 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -249,12 +249,12 @@ static int mdt_last_rcvd_read(const struct lu_env *env, "uuid = %s\n" "last_transno = "LPU64"\n" "last_xid = "LPU64"\n" - "last_result = %d\n" - "last_data = %d\n" + "last_result = %u\n" + "last_data = %u\n" "last_close_transno = "LPU64"\n" "last_close_xid = "LPU64"\n" - "last_close_result = %d\n", - (int)*off - sizeof(*tmp), + "last_close_result = %u\n", + (int)(*off - sizeof(*tmp)), rc, lcd->lcd_uuid, lcd->lcd_last_transno, @@ -289,12 +289,12 @@ static int mdt_last_rcvd_write(const struct lu_env *env, "uuid = %s\n" "last_transno = "LPU64"\n" "last_xid = "LPU64"\n" - "last_result = %d\n" - "last_data = %d\n" + "last_result = %u\n" + "last_data = %u\n" "last_close_transno = "LPU64"\n" "last_close_xid = "LPU64"\n" - "last_close_result = %d\n", - (int)*off - sizeof(*tmp), + "last_close_result = %u\n", + (int)(*off - sizeof(*tmp)), rc, lcd->lcd_uuid, lcd->lcd_last_transno, @@ -613,7 +613,7 @@ int mdt_client_new(const struct lu_env *env, struct mdt_device *mdt) spin_unlock(&mti->mti_exp->exp_lock); rc = mdt_last_rcvd_write(env, mdt, lcd, &off, th); - CDEBUG(D_INFO, "wrote client lcd at idx %u off %llu (len %u)\n", + CDEBUG(D_INFO, "wrote client lcd at idx %u off %llu (len "LPSZ")\n", cl_idx, med->med_lr_off, sizeof(*lcd)); mdt_trans_stop(env, mdt, th); diff --git a/lustre/obdclass/capa.c b/lustre/obdclass/capa.c index 2bbc687..11deec6 100644 --- a/lustre/obdclass/capa.c +++ b/lustre/obdclass/capa.c @@ -117,7 +117,7 @@ void cleanup_capa_hash(struct hlist_head *hash) OBD_FREE(hash, CFS_PAGE_SIZE); } -static inline int const capa_hashfn(struct lu_fid *fid) +static inline int capa_hashfn(struct lu_fid *fid) { return (fid_oid(fid) ^ fid_ver(fid)) * (unsigned long)(fid_seq(fid) + 1) % NR_CAPAHASH; diff --git a/lustre/ptlrpc/sec_bulk.c b/lustre/ptlrpc/sec_bulk.c index f6861bc..65b6290 100644 --- a/lustre/ptlrpc/sec_bulk.c +++ b/lustre/ptlrpc/sec_bulk.c @@ -1005,7 +1005,7 @@ static int do_bulk_checksum(struct ptlrpc_bulk_desc *desc, __u32 alg, void *buf) csum32 = ~0; for (i = 0; i < desc->bd_iov_count; i++) { - char *ptr = desc->bd_iov[i].iov_base; + unsigned char *ptr = desc->bd_iov[i].iov_base; int len = desc->bd_iov[i].iov_len; switch (alg) { diff --git a/lustre/utils/libiam.c b/lustre/utils/libiam.c index dafee2f..dcdc875 100644 --- a/lustre/utils/libiam.c +++ b/lustre/utils/libiam.c @@ -307,7 +307,7 @@ static unsigned char *packdigit(unsigned char *number) unsigned char *area; unsigned char *scan; - area = calloc(strlen(number) / 2 + 2, sizeof(char)); + area = calloc(strlen((char *)number) / 2 + 2, sizeof(char)); if (area != NULL) { for (scan = area; *number; number += 2, scan++) *scan = (hex2dec(number[0]) << 4) | hex2dec(number[1]); @@ -318,7 +318,7 @@ static unsigned char *packdigit(unsigned char *number) static char *iam_convert(int size, int need_convert, char *source) { char *ptr; - char *opt; + unsigned char *opt; if (source == NULL) return NULL; @@ -328,7 +328,7 @@ static char *iam_convert(int size, int need_convert, char *source) return NULL; if (need_convert) { - opt = packdigit(source); + opt = packdigit((unsigned char*)source); if (opt == NULL) { free(ptr); return NULL; -- 1.8.3.1