From: Jian Yu Date: Sat, 20 Nov 2010 12:15:18 +0000 (+0800) Subject: b=24022 don't return NULL in lprocfs_alloc_stats to satisfy userspace error checker X-Git-Tag: 2.1.57.0~26 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8bc17daa978ec635b22ab6505be31626fbb0f3ed b=24022 don't return NULL in lprocfs_alloc_stats to satisfy userspace error checker o=Liang Zhen i=vitaly.fertman --- diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index f1af794..7c55f20 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -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)