Whamcloud - gitweb
Cleanup Compiler Warnings(Patch by Robert Read)
authorgirish <girish>
Thu, 17 Jul 2008 17:35:08 +0000 (17:35 +0000)
committergirish <girish>
Thu, 17 Jul 2008 17:35:08 +0000 (17:35 +0000)
b=15981
i=adilger
i=girish

lustre/include/liblustre.h
lustre/include/lustre_mdc.h
lustre/liblustre/tests/test_common.c
lustre/llite/dir.c
lustre/mdd/mdd_object.c
lustre/mdt/mdt_recovery.c
lustre/obdclass/capa.c
lustre/ptlrpc/sec_bulk.c
lustre/utils/libiam.c

index 79ffd50..c7a4fcb 100644 (file)
@@ -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)
                 .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
 #define TASK_INTERRUPTIBLE 0
 #define TASK_UNINTERRUPTIBLE 1
 #define TASK_RUNNING 2
index 9a9a02a..c71b03f 100644 (file)
@@ -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;
 
 struct mdc_cache_waiter {       
         struct list_head        mcw_entry;
-        wait_queue_head_t       mcw_waitq;
+        cfs_waitq_t             mcw_waitq;
 };
 
 /* mdc/mdc_locks.c */
 };
 
 /* mdc/mdc_locks.c */
index 8b7ba3b..3bfffd2 100644 (file)
@@ -24,6 +24,10 @@ int exit_on_err = 1;
  * util functions
  ******************************************************************/
 
  * util functions
  ******************************************************************/
 
+#ifdef EXIT
+#undef EXIT
+#endif
+
 #define EXIT(err)                                      \
        do {                                            \
                if (exit_on_err)                        \
 #define EXIT(err)                                      \
        do {                                            \
                if (exit_on_err)                        \
index b854067..5189f2f 100644 (file)
@@ -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;
         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,
 
         mode = LCK_PR;
         rc = md_lock_match(ll_i2sbi(dir)->ll_md_exp, LDLM_FL_BLOCK_GRANTED,
index ca302fb..eacbd6d 100644 (file)
@@ -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 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;
         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);
 
         LASSERT(rdpg->rp_pages != NULL);
         LASSERT(next->do_index_ops != NULL);
index 131a4f2..3a6ab9f 100644 (file)
@@ -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"
                        "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_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,
                         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"
                        "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_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,
                         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);
         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);
 
                cl_idx, med->med_lr_off, sizeof(*lcd));
         mdt_trans_stop(env, mdt, th);
 
index 2bbc687..11deec6 100644 (file)
@@ -117,7 +117,7 @@ void cleanup_capa_hash(struct hlist_head *hash)
         OBD_FREE(hash, CFS_PAGE_SIZE);
 }
 
         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;
 {
         return (fid_oid(fid) ^ fid_ver(fid)) *
                (unsigned long)(fid_seq(fid) + 1) % NR_CAPAHASH;
index f6861bc..65b6290 100644 (file)
@@ -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++) {
                 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) {
                 int len = desc->bd_iov[i].iov_len;
 
                 switch (alg) {
index dafee2f..dcdc875 100644 (file)
@@ -307,7 +307,7 @@ static unsigned char *packdigit(unsigned char *number)
         unsigned char *area;
         unsigned char *scan;
 
         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]);
         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;
 static char *iam_convert(int size, int need_convert, char *source)
 {
         char *ptr;
-        char *opt;
+        unsigned char *opt;
 
         if (source == NULL)
                 return NULL;
 
         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) {
                 return NULL;
 
         if (need_convert) {
-                opt = packdigit(source);
+                opt = packdigit((unsigned char*)source);
                 if (opt == NULL) {
                         free(ptr);
                         return NULL;
                 if (opt == NULL) {
                         free(ptr);
                         return NULL;