summaryrefslogtreecommitdiff
path: root/target/mips/dragino-ms14s/patches/3.14.35/0024-various-fixups-for-Werror.patch
blob: 77883846d58a2e80ba068dd8aa5342c5fe5a33cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From 45bdbeaf12f96a95bda6016a2aa943ae2dfceb96 Mon Sep 17 00:00:00 2001
From: Phil Sutter <phil@nwl.cc>
Date: Fri, 16 May 2014 04:37:17 +0200
Subject: [PATCH] various fixups for -Werror

---
 arch/mips/ath79/common.c   |  4 ++--
 arch/mips/ath79/dev-eth.c  |  8 ++++----
 drivers/net/phy/swconfig.c | 18 +-----------------
 3 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
index eb3966c..def54c2 100644
--- a/arch/mips/ath79/common.c
+++ b/arch/mips/ath79/common.c
@@ -59,7 +59,7 @@ EXPORT_SYMBOL_GPL(ath79_ddr_wb_flush);
 void ath79_device_reset_set(u32 mask)
 {
 	unsigned long flags;
-	u32 reg;
+	u32 reg = 0;
 	u32 t;
 
 	if (soc_is_ar71xx())
@@ -87,7 +87,7 @@ EXPORT_SYMBOL_GPL(ath79_device_reset_set);
 void ath79_device_reset_clear(u32 mask)
 {
 	unsigned long flags;
-	u32 reg;
+	u32 reg = 0;
 	u32 t;
 
 	if (soc_is_ar71xx())
diff --git a/arch/mips/ath79/dev-eth.c b/arch/mips/ath79/dev-eth.c
index 21feeb9..879f1cd 100644
--- a/arch/mips/ath79/dev-eth.c
+++ b/arch/mips/ath79/dev-eth.c
@@ -121,7 +121,7 @@ static void __init ath79_mii_ctrl_set_if(unsigned int reg,
 static void ath79_mii_ctrl_set_speed(unsigned int reg, unsigned int speed)
 {
 	void __iomem *base;
-	unsigned int mii_speed;
+	unsigned int mii_speed = 0;
 	u32 t;
 
 	switch (speed) {
@@ -271,8 +271,8 @@ struct ath79_eth_pll_data ath79_eth1_pll_data;
 
 static u32 ath79_get_eth_pll(unsigned int mac, int speed)
 {
-	struct ath79_eth_pll_data *pll_data;
-	u32 pll_val;
+	struct ath79_eth_pll_data *pll_data = NULL;
+	u32 pll_val = 0;
 
 	switch (mac) {
 	case 0:
@@ -511,7 +511,7 @@ struct ag71xx_switch_platform_data ath79_switch_data;
 static void __init ath79_init_eth_pll_data(unsigned int id)
 {
 	struct ath79_eth_pll_data *pll_data;
-	u32 pll_10, pll_100, pll_1000;
+	u32 pll_10 = 0, pll_100 = 0, pll_1000 = 0;
 
 	switch (id) {
 	case 0:
diff --git a/drivers/net/phy/swconfig.c b/drivers/net/phy/swconfig.c
index c043ee4..c4d7689 100644
--- a/drivers/net/phy/swconfig.c
+++ b/drivers/net/phy/swconfig.c
@@ -1107,30 +1107,14 @@ EXPORT_SYMBOL_GPL(unregister_switch);
 static int __init
 swconfig_init(void)
 {
-	int i, err;
+	int err;
 
 	INIT_LIST_HEAD(&swdevs);
-	
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0))
-	err = genl_register_family(&switch_fam);
-	if (err)
-		return err;
 
-	for (i = 0; i < ARRAY_SIZE(swconfig_ops); i++) {
-		err = genl_register_ops(&switch_fam, &swconfig_ops[i]);
-		if (err)
-			goto unregister;
-	}
-#else
 	err = genl_register_family_with_ops(&switch_fam, swconfig_ops);
 	if (err)
 		return err;
-#endif
 	return 0;
-
-unregister:
-	genl_unregister_family(&switch_fam);
-	return err;
 }
 
 static void __exit
-- 
1.8.5.3