jianhai / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
e293be
When compiling for i686, drivers/infiniband/hw/cxgb4/device.o 
e293be
fails to compile:
e293be
e293be
drivers/infiniband/hw/cxgb4/device.c: In function 'wr_log_show':
e293be
include/linux/ktime.h:84:36: error: 'prev_time.tv64' may be used uninitialized in this function [-Werror=maybe-uninitialized]
e293be
({ (ktime_t){ .tv64 = (lhs).tv64 - (rhs).tv64 }; })
e293be
^
e293be
drivers/infiniband/hw/cxgb4/device.c:133:10: note: 'prev_time.tv64' was declared here
e293be
ktime_t prev_time;
e293be
^
e293be
cc1: all warnings being treated as errors
e293be
make[5]: *** [drivers/infiniband/hw/cxgb4/device.o] Error 1
e293be
e293be
I don't know why x86_64 is compiling without this patch.
e293be
Compiler (gcc) version dependence?
e293be
e293be
diff -up ./drivers/infiniband/hw/cxgb4/device.c.tv64 ./drivers/infiniband/hw/cxgb4/device.c
e293be
--- ./drivers/infiniband/hw/cxgb4/device.c.tv64	2018-10-05 05:18:19.000000000 +0900
e293be
+++ ./drivers/infiniband/hw/cxgb4/device.c	2018-11-01 09:34:48.000000000 +0900
e293be
@@ -130,7 +130,7 @@ void c4iw_log_wr_stats(struct t4_wq *wq,
e293be
 static int wr_log_show(struct seq_file *seq, void *v)
e293be
 {
e293be
 	struct c4iw_dev *dev = seq->private;
e293be
-	ktime_t prev_time;
e293be
+	ktime_t prev_time = { .tv64 = 0 };
e293be
 	struct wr_log_entry *lep;
e293be
 	int prev_time_set = 0;
e293be
 	int idx, end;