[rh7] fs/fuse kio: fix warning about possible noninitialized variables in possible do_show_cs_stats()

Submitted by Konstantin Khorenko on May 30, 2019, 8:40 a.m.

Details

Message ID 20190530084024.28229-1-khorenko@virtuozzo.com
State New
Series "fs/fuse kio: fix warning about possible noninitialized variables in possible do_show_cs_stats()"
Headers show

Commit Message

Konstantin Khorenko May 30, 2019, 8:40 a.m.
It's impossible to have none possible cpus, but gcc is not aware of it.

Fixes: 049aa5f3a22c fs/fuse kio: implement cs_stats statistics info

Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 fs/fuse/kio/pcs/fuse_stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/fuse_stat.c b/fs/fuse/kio/pcs/fuse_stat.c
index 1b44793d25f8..542591a65550 100644
--- a/fs/fuse/kio/pcs/fuse_stat.c
+++ b/fs/fuse/kio/pcs/fuse_stat.c
@@ -314,7 +314,10 @@  static int do_show_cs_stats(struct pcs_cs *cs, void *ctx)
 	int rpc_state = cs->rpc ? cs->rpc->state : PCS_RPC_UNCONN;
 	unsigned int in_flight_avg = cs->in_flight_avg;
 	struct fuse_lat_stat iolat, netlat;
-	struct pcs_perf_rate_cnt read_ops_rate, write_ops_rate, sync_ops_rate;
+	/* Supress warning about possible non-initinialized variables */
+	struct pcs_perf_rate_cnt read_ops_rate  = {},
+				 write_ops_rate = {},
+				 sync_ops_rate  = {};
 	unsigned seq;
 
 	do {