]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
gianfar: Fix sparse warnings
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Sun, 1 Feb 2009 08:54:16 +0000 (00:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Feb 2009 08:54:16 +0000 (00:54 -0800)
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>
drivers/net/gianfar.c
drivers/net/gianfar.h
drivers/net/gianfar_mii.c
drivers/net/gianfar_sysfs.c

index 4d2ca490d76cf86eb21c14a5c34f0ce6e8d1cb81..eb8302c5ba8c40baa0c3304fe1a156471ece400f 100644 (file)
@@ -141,8 +141,6 @@ void gfar_start(struct net_device *dev);
 static void gfar_clear_exact_match(struct net_device *dev);
 static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr);
 
-extern const struct ethtool_ops gfar_ethtool_ops;
-
 MODULE_AUTHOR("Freescale Semiconductor, Inc");
 MODULE_DESCRIPTION("Gianfar Ethernet Driver");
 MODULE_LICENSE("GPL");
index b1a83344acc75de952a5b4ed3345448595875d33..7820720ceeedb4dc3c1fe7cbd5b81e70bcbcc287 100644 (file)
@@ -830,4 +830,6 @@ int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id,
                          int regnum, u16 value);
 int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum);
 
+extern const struct ethtool_ops gfar_ethtool_ops;
+
 #endif /* __GIANFAR_H */
index f49a426ad681c1996f7675f8e993eb784e4981af..64e4679b3279e8f93e65265c5e709cbc7c5c92f5 100644 (file)
@@ -105,7 +105,7 @@ int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum)
  * All PHY configuration is done through the TSEC1 MIIM regs */
 int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
 {
-       struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
+       struct gfar_mii __iomem *regs = (void __force __iomem *)bus->priv;
 
        /* Write to the local MII regs */
        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)
  * configuration has to be done through the TSEC1 MIIM regs */
 int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
 {
-       struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
+       struct gfar_mii __iomem *regs = (void __force __iomem *)bus->priv;
 
        /* Read the local MII regs */
        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)
 /* Reset the MIIM registers, and wait for the bus to free */
 static int gfar_mdio_reset(struct mii_bus *bus)
 {
-       struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
+       struct gfar_mii __iomem *regs = (void __force __iomem *)bus->priv;
        unsigned int timeout = PHY_INIT_TIMEOUT;
 
        mutex_lock(&bus->mdio_lock);
@@ -268,8 +268,8 @@ static int gfar_mdio_probe(struct of_device *ofdev,
         * Also, we have to cast back to struct gfar_mii because of
         * definition weirdness done in gianfar.h.
         */
-       enet_regs = (struct gfar __iomem *)
-               ((char *)regs - offsetof(struct gfar, gfar_mii_regs));
+       enet_regs = (struct gfar __force __iomem *)
+               ((char __force *)regs - offsetof(struct gfar, gfar_mii_regs));
 
        for_each_child_of_node(np, tbi) {
                if (!strncmp(tbi->type, "tbi-phy", 8))
@@ -337,7 +337,7 @@ static int gfar_mdio_remove(struct of_device *ofdev)
 
        dev_set_drvdata(&ofdev->dev, NULL);
 
-       iounmap((void __iomem *)bus->priv);
+       iounmap((void __force __iomem *)bus->priv);
        bus->priv = NULL;
        kfree(bus->irq);
        mdiobus_free(bus);
index 782c201700820c45abb1cddfd1dba606ba6c38ae..74e0b4d42587ae5dd112cb47124d0789e45c63ae 100644 (file)
@@ -81,7 +81,7 @@ static ssize_t gfar_set_bd_stash(struct device *dev,
        return count;
 }
 
-DEVICE_ATTR(bd_stash, 0644, gfar_show_bd_stash, gfar_set_bd_stash);
+static DEVICE_ATTR(bd_stash, 0644, gfar_show_bd_stash, gfar_set_bd_stash);
 
 static ssize_t gfar_show_rx_stash_size(struct device *dev,
                                       struct device_attribute *attr, char *buf)
@@ -130,8 +130,8 @@ out:
        return count;
 }
 
-DEVICE_ATTR(rx_stash_size, 0644, gfar_show_rx_stash_size,
-           gfar_set_rx_stash_size);
+static DEVICE_ATTR(rx_stash_size, 0644, gfar_show_rx_stash_size,
+                  gfar_set_rx_stash_size);
 
 /* Stashing will only be enabled when rx_stash_size != 0 */
 static ssize_t gfar_show_rx_stash_index(struct device *dev,
@@ -172,8 +172,8 @@ out:
        return count;
 }
 
-DEVICE_ATTR(rx_stash_index, 0644, gfar_show_rx_stash_index,
-           gfar_set_rx_stash_index);
+static DEVICE_ATTR(rx_stash_index, 0644, gfar_show_rx_stash_index,
+                  gfar_set_rx_stash_index);
 
 static ssize_t gfar_show_fifo_threshold(struct device *dev,
                                        struct device_attribute *attr,
@@ -210,8 +210,8 @@ static ssize_t gfar_set_fifo_threshold(struct device *dev,
        return count;
 }
 
-DEVICE_ATTR(fifo_threshold, 0644, gfar_show_fifo_threshold,
-           gfar_set_fifo_threshold);
+static DEVICE_ATTR(fifo_threshold, 0644, gfar_show_fifo_threshold,
+                  gfar_set_fifo_threshold);
 
 static ssize_t gfar_show_fifo_starve(struct device *dev,
                                     struct device_attribute *attr, char *buf)
@@ -247,7 +247,8 @@ static ssize_t gfar_set_fifo_starve(struct device *dev,
        return count;
 }
 
-DEVICE_ATTR(fifo_starve, 0644, gfar_show_fifo_starve, gfar_set_fifo_starve);
+static DEVICE_ATTR(fifo_starve, 0644, gfar_show_fifo_starve,
+                  gfar_set_fifo_starve);
 
 static ssize_t gfar_show_fifo_starve_off(struct device *dev,
                                         struct device_attribute *attr,
@@ -284,8 +285,8 @@ static ssize_t gfar_set_fifo_starve_off(struct device *dev,
        return count;
 }
 
-DEVICE_ATTR(fifo_starve_off, 0644, gfar_show_fifo_starve_off,
-           gfar_set_fifo_starve_off);
+static DEVICE_ATTR(fifo_starve_off, 0644, gfar_show_fifo_starve_off,
+                  gfar_set_fifo_starve_off);
 
 void gfar_init_sysfs(struct net_device *dev)
 {