Whamcloud - gitweb
Branch b1_4
authorscjody <scjody>
Thu, 29 Mar 2007 21:51:47 +0000 (21:51 +0000)
committerscjody <scjody>
Thu, 29 Mar 2007 21:51:47 +0000 (21:51 +0000)
Cleanup compiler warnings on liblustre - patch by nic@cray.com

b=11175
r=adilger
r=green
r=scjody

lnet/include/libcfs/linux/kp30.h
lnet/include/libcfs/linux/linux-time.h
lnet/utils/routerstat.c
lustrecvs

index be2cd34..a1e3b7c 100644 (file)
@@ -309,7 +309,15 @@ extern int  lwt_snapshot (cycles_t *now, int *ncpu, int *total_size,
 # define LP_POISON ((void *)(long)0x5a5a5a5a)
 #endif
 
-#if (defined(__x86_64__) && defined(__KERNEL__))
+/* this is a bit chunky */
+
+#if defined(__KERNEL__)
+ #define _LWORDSIZE BITS_PER_LONG
+#else
+ #define _LWORDSIZE __WORDSIZE
+#endif
+
+#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3)))
 /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
 # define LPU64 "%Lu"
 # define LPD64 "%Ld"
@@ -317,14 +325,14 @@ extern int  lwt_snapshot (cycles_t *now, int *ncpu, int *total_size,
 # define LPF64 "L"
 # define LPSZ  "%lu"
 # define LPSSZ "%ld"
-#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
+#elif (_LWORDSIZE == 32)
 # define LPU64 "%Lu"
 # define LPD64 "%Ld"
 # define LPX64 "%#Lx"
 # define LPF64 "L"
 # define LPSZ  "%u"
 # define LPSSZ "%d"
-#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
+#elif (_LWORDSIZE == 64)
 # define LPU64 "%lu"
 # define LPD64 "%ld"
 # define LPX64 "%#lx"
@@ -336,4 +344,6 @@ extern int  lwt_snapshot (cycles_t *now, int *ncpu, int *total_size,
 # error "No word size defined"
 #endif
 
+#undef _LWORDSIZE
+
 #endif
index 7135218..e928387 100644 (file)
@@ -234,7 +234,7 @@ static inline time_t cfs_duration_sec(cfs_duration_t d)
 static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
 {
 #if (BITS_PER_LONG == 32) && (HZ > 4096)
-        uint64_t t;
+        __u64 t;
 
         s->tv_sec = d / HZ;
         t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION;
@@ -248,7 +248,7 @@ static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
 static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
 {
 #if (BITS_PER_LONG == 32)
-        uint64_t t;
+        __u64 t;
 
         s->tv_sec = d / HZ;
         t = (d - s->tv_sec * HZ) * ONE_BILLION;
index febe89a..0b4e513 100644 (file)
@@ -78,7 +78,7 @@ do_stat (int fd)
    }    
    buffer[n] = 0;
    
-   n = sscanf (buffer, "%u %u %u %u %u %u %u %Lu %Lu %Lu %Lu",
+   n = sscanf (buffer, "%lu %lu %lu %lu %lu %lu %lu %Lu %Lu %Lu %Lu",
               &new_counter.msgs_alloc, &new_counter.msgs_max,
               &new_counter.errors, 
               &new_counter.send_count, &new_counter.recv_count,
index b0f8088..acf7c95 100755 (executable)
--- a/lustrecvs
+++ b/lustrecvs
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 LC_COLLATE="C"
 progname="${0##*/}"