Whamcloud - gitweb
b=24022 don't return NULL in lprocfs_alloc_stats to satisfy userspace error checker
authorJian Yu <jian.yu@oracle.com>
Sat, 20 Nov 2010 12:15:18 +0000 (20:15 +0800)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Tue, 23 Nov 2010 21:29:50 +0000 (00:29 +0300)
o=Liang Zhen
i=vitaly.fertman

lustre/include/lprocfs_status.h

index f1af794..7c55f20 100644 (file)
@@ -711,12 +711,12 @@ static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
                                         int index)
 { return; }
-static inline void lprocfs_counter_decr(struct lprocfs_stats *stats,
-                                        int index)
-{ return; }
 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
                                        int index, long amount)
 { return; }
+static inline void lprocfs_counter_decr(struct lprocfs_stats *stats,
+                                        int index)
+{ return; }
 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
                                         int index, unsigned conf,
                                         const char *name, const char *units)
@@ -726,9 +726,10 @@ static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
                                    enum lprocfs_fields_flags field)
 { return 0; }
 
+/* NB: we return !NULL to satisfy error checker */
 static inline struct lprocfs_stats *
 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags)
-{ return NULL; }
+{ return (struct lprocfs_stats *)1; }
 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
 { return; }
 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)