Whamcloud - gitweb
LU-17504 build: fix array-index-out-of-bounds warning
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
index 95a5492..572564a 100644 (file)
@@ -169,17 +169,9 @@ struct lprocfs_counter {
        __s64   lc_count;
        __s64   lc_min;
        __s64   lc_max;
+       __s64   lc_sum;
        __s64   lc_sumsquare;
-       /*
-        * Every counter has lc_array_sum[0], while lc_array_sum[1] is only
-        * for irq context counter, i.e. stats with
-        * LPROCFS_STATS_FLAG_IRQ_SAFE flag, its counter need
-        * lc_array_sum[1]
-        */
-       __s64   lc_array_sum[1];
 };
-#define lc_sum         lc_array_sum[0]
-#define lc_sum_irq     lc_array_sum[1]
 
 struct lprocfs_percpu {
        struct lprocfs_counter lp_cntr[0];
@@ -193,7 +185,6 @@ enum lprocfs_stats_lock_ops {
 enum lprocfs_stats_flags {
        LPROCFS_STATS_FLAG_NONE     = 0x0000, /* per cpu counter */
        LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* need locking(no percpu area) */
-       LPROCFS_STATS_FLAG_IRQ_SAFE = 0x0002, /* alloc need irq safe */
 };
 
 enum lprocfs_fields_flags {
@@ -477,10 +468,6 @@ lprocfs_stats_counter_size(struct lprocfs_stats *stats)
 
        percpusize = offsetof(struct lprocfs_percpu, lp_cntr[stats->ls_num]);
 
-       /* irq safe stats need lc_array_sum[1] */
-       if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
-               percpusize += stats->ls_num * sizeof(__s64);
-
        if ((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0)
                percpusize = L1_CACHE_ALIGN(percpusize);
 
@@ -495,9 +482,6 @@ lprocfs_stats_counter_get(struct lprocfs_stats *stats, unsigned int cpuid,
 
        cntr = &stats->ls_percpu[cpuid]->lp_cntr[index];
 
-       if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
-               cntr = (void *)cntr + index * sizeof(__s64);
-
        return cntr;
 }