aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-02-01 03:54:16 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-01 03:54:16 -0500
commitb2f66d183966114fcc91591191ec9af14a252ac5 (patch)
treee47ff4df2eec80073c4cf7f6e3495fd258bbf70a /drivers/net
parent3d1e4db2b0698785f4e4dd139d88257e855e53b8 (diff)
gianfar: Fix sparse warnings
This patch fixes following sparse warnings: CHECK gianfar_ethtool.c gianfar_ethtool.c:610:26: warning: symbol 'gfar_ethtool_ops' was not declared. Should it be static? CHECK gianfar_mii.c gianfar_mii.c:108:35: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:119:35: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:128:35: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:272:5: warning: cast removes address space of expression gianfar_mii.c:271:15: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:340:11: warning: cast adds address space to expression (<asn:2>) CHECK gianfar_sysfs.c gianfar_sysfs.c:84:1: warning: symbol 'dev_attr_bd_stash' was not declared. Should it be static? gianfar_sysfs.c:133:1: warning: symbol 'dev_attr_rx_stash_size' was not declared. Should it be static? gianfar_sysfs.c:175:1: warning: symbol 'dev_attr_rx_stash_index' was not declared. Should it be static? gianfar_sysfs.c:213:1: warning: symbol 'dev_attr_fifo_threshold' was not declared. Should it be static? gianfar_sysfs.c:250:1: warning: symbol 'dev_attr_fifo_starve' was not declared. Should it be static? gianfar_sysfs.c:287:1: warning: symbol 'dev_attr_fifo_starve_off' was not declared. Should it be static? Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/gianfar.c2
-rw-r--r--drivers/net/gianfar.h2
-rw-r--r--drivers/net/gianfar_mii.c12
-rw-r--r--drivers/net/gianfar_sysfs.c21
4 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 4d2ca490d76..eb8302c5ba8 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -141,8 +141,6 @@ void gfar_start(struct net_device *dev);
141static void gfar_clear_exact_match(struct net_device *dev); 141static void gfar_clear_exact_match(struct net_device *dev);
142static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr); 142static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr);
143 143
144extern const struct ethtool_ops gfar_ethtool_ops;
145
146MODULE_AUTHOR("Freescale Semiconductor, Inc"); 144MODULE_AUTHOR("Freescale Semiconductor, Inc");
147MODULE_DESCRIPTION("Gianfar Ethernet Driver"); 145MODULE_DESCRIPTION("Gianfar Ethernet Driver");
148MODULE_LICENSE("GPL"); 146MODULE_LICENSE("GPL");
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index b1a83344acc..7820720ceee 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -830,4 +830,6 @@ int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id,
830 int regnum, u16 value); 830 int regnum, u16 value);
831int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); 831int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum);
832 832
833extern const struct ethtool_ops gfar_ethtool_ops;
834
833#endif /* __GIANFAR_H */ 835#endif /* __GIANFAR_H */
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index f49a426ad68..64e4679b327 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -105,7 +105,7 @@ int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum)
105 * All PHY configuration is done through the TSEC1 MIIM regs */ 105 * All PHY configuration is done through the TSEC1 MIIM regs */
106int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value) 106int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
107{ 107{
108 struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; 108 struct gfar_mii __iomem *regs = (void __force __iomem *)bus->priv;
109 109
110 /* Write to the local MII regs */ 110 /* Write to the local MII regs */
111 return(gfar_local_mdio_write(regs, mii_id, regnum, value)); 111 return(gfar_local_mdio_write(regs, mii_id, regnum, value));
@@ -116,7 +116,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
116 * configuration has to be done through the TSEC1 MIIM regs */ 116 * configuration has to be done through the TSEC1 MIIM regs */
117int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum) 117int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
118{ 118{
119 struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; 119 struct gfar_mii __iomem *regs = (void __force __iomem *)bus->priv;
120 120
121 /* Read the local MII regs */ 121 /* Read the local MII regs */
122 return(gfar_local_mdio_read(regs, mii_id, regnum)); 122 return(gfar_local_mdio_read(regs, mii_id, regnum));
@@ -125,7 +125,7 @@ int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
125/* Reset the MIIM registers, and wait for the bus to free */ 125/* Reset the MIIM registers, and wait for the bus to free */
126static int gfar_mdio_reset(struct mii_bus *bus) 126static int gfar_mdio_reset(struct mii_bus *bus)
127{ 127{
128 struct gfar_mii __iomem *regs = (void __iomem *)bus->priv; 128 struct gfar_mii __iomem *regs = (void __force __iomem *)bus->priv;
129 unsigned int timeout = PHY_INIT_TIMEOUT; 129 unsigned int timeout = PHY_INIT_TIMEOUT;
130 130
131 mutex_lock(&bus->mdio_lock); 131 mutex_lock(&bus->mdio_lock);
@@ -268,8 +268,8 @@ static int gfar_mdio_probe(struct of_device *ofdev,
268 * Also, we have to cast back to struct gfar_mii because of 268 * Also, we have to cast back to struct gfar_mii because of
269 * definition weirdness done in gianfar.h. 269 * definition weirdness done in gianfar.h.
270 */ 270 */
271 enet_regs = (struct gfar __iomem *) 271 enet_regs = (struct gfar __force __iomem *)
272 ((char *)regs - offsetof(struct gfar, gfar_mii_regs)); 272 ((char __force *)regs - offsetof(struct gfar, gfar_mii_regs));
273 273
274 for_each_child_of_node(np, tbi) { 274 for_each_child_of_node(np, tbi) {
275 if (!strncmp(tbi->type, "tbi-phy", 8)) 275 if (!strncmp(tbi->type, "tbi-phy", 8))
@@ -337,7 +337,7 @@ static int gfar_mdio_remove(struct of_device *ofdev)
337 337
338 dev_set_drvdata(&ofdev->dev, NULL); 338 dev_set_drvdata(&ofdev->dev, NULL);
339 339
340 iounmap((void __iomem *)bus->priv); 340 iounmap((void __force __iomem *)bus->priv);
341 bus->priv = NULL; 341 bus->priv = NULL;
342 kfree(bus->irq); 342 kfree(bus->irq);
343 mdiobus_free(bus); 343 mdiobus_free(bus);
diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 782c2017008..74e0b4d4258 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -81,7 +81,7 @@ static ssize_t gfar_set_bd_stash(struct device *dev,
81 return count; 81 return count;
82} 82}
83 83
84DEVICE_ATTR(bd_stash, 0644, gfar_show_bd_stash, gfar_set_bd_stash); 84static DEVICE_ATTR(bd_stash, 0644, gfar_show_bd_stash, gfar_set_bd_stash);
85 85
86static ssize_t gfar_show_rx_stash_size(struct device *dev, 86static ssize_t gfar_show_rx_stash_size(struct device *dev,
87 struct device_attribute *attr, char *buf) 87 struct device_attribute *attr, char *buf)
@@ -130,8 +130,8 @@ out:
130 return count; 130 return count;
131} 131}
132 132
133DEVICE_ATTR(rx_stash_size, 0644, gfar_show_rx_stash_size, 133static DEVICE_ATTR(rx_stash_size, 0644, gfar_show_rx_stash_size,
134 gfar_set_rx_stash_size); 134 gfar_set_rx_stash_size);
135 135
136/* Stashing will only be enabled when rx_stash_size != 0 */ 136/* Stashing will only be enabled when rx_stash_size != 0 */
137static ssize_t gfar_show_rx_stash_index(struct device *dev, 137static ssize_t gfar_show_rx_stash_index(struct device *dev,
@@ -172,8 +172,8 @@ out:
172 return count; 172 return count;
173} 173}
174 174
175DEVICE_ATTR(rx_stash_index, 0644, gfar_show_rx_stash_index, 175static DEVICE_ATTR(rx_stash_index, 0644, gfar_show_rx_stash_index,
176 gfar_set_rx_stash_index); 176 gfar_set_rx_stash_index);
177 177
178static ssize_t gfar_show_fifo_threshold(struct device *dev, 178static ssize_t gfar_show_fifo_threshold(struct device *dev,
179 struct device_attribute *attr, 179 struct device_attribute *attr,
@@ -210,8 +210,8 @@ static ssize_t gfar_set_fifo_threshold(struct device *dev,
210 return count; 210 return count;
211} 211}
212 212
213DEVICE_ATTR(fifo_threshold, 0644, gfar_show_fifo_threshold, 213static DEVICE_ATTR(fifo_threshold, 0644, gfar_show_fifo_threshold,
214 gfar_set_fifo_threshold); 214 gfar_set_fifo_threshold);
215 215
216static ssize_t gfar_show_fifo_starve(struct device *dev, 216static ssize_t gfar_show_fifo_starve(struct device *dev,
217 struct device_attribute *attr, char *buf) 217 struct device_attribute *attr, char *buf)
@@ -247,7 +247,8 @@ static ssize_t gfar_set_fifo_starve(struct device *dev,
247 return count; 247 return count;
248} 248}
249 249
250DEVICE_ATTR(fifo_starve, 0644, gfar_show_fifo_starve, gfar_set_fifo_starve); 250static DEVICE_ATTR(fifo_starve, 0644, gfar_show_fifo_starve,
251 gfar_set_fifo_starve);
251 252
252static ssize_t gfar_show_fifo_starve_off(struct device *dev, 253static ssize_t gfar_show_fifo_starve_off(struct device *dev,
253 struct device_attribute *attr, 254 struct device_attribute *attr,
@@ -284,8 +285,8 @@ static ssize_t gfar_set_fifo_starve_off(struct device *dev,
284 return count; 285 return count;
285} 286}
286 287
287DEVICE_ATTR(fifo_starve_off, 0644, gfar_show_fifo_starve_off, 288static DEVICE_ATTR(fifo_starve_off, 0644, gfar_show_fifo_starve_off,
288 gfar_set_fifo_starve_off); 289 gfar_set_fifo_starve_off);
289 290
290void gfar_init_sysfs(struct net_device *dev) 291void gfar_init_sysfs(struct net_device *dev)
291{ 292{