aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dnet.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2010-10-12 18:20:34 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-16 14:13:20 -0400
commit35f2516f0a1f9dddb339849c7a07e089322c18c3 (patch)
tree620950ee691d2b25ad7d13bd64f8a3d6dc30593d /drivers/net/dnet.c
parent65495745d7d617893f368bf5580353f5d2d88908 (diff)
dnet: mark methods static and annotate for correct endianness
Their doesn't appear to be bugs with the endianness handling here, just get the annotations right to keep sparse happy. Suppresses the following sparse warnings: drivers/net/dnet.c:30:5: warning: symbol 'dnet_readw_mac' was not declared. Should it be static? drivers/net/dnet.c:49:6: warning: symbol 'dnet_writew_mac' was not declared. Should it be static? drivers/net/dnet.c:364:5: warning: symbol 'dnet_phy_marvell_fixup' was not declared. Should it be static? drivers/net/dnet.c:66:13: warning: incorrect type in assignment (different base types) drivers/net/dnet.c:66:13: expected unsigned short [unsigned] [usertype] tmp drivers/net/dnet.c:66:13: got restricted __be16 [usertype] <noident> drivers/net/dnet.c:68:13: warning: incorrect type in assignment (different base types) drivers/net/dnet.c:68:13: expected unsigned short [unsigned] [usertype] tmp drivers/net/dnet.c:68:13: got restricted __be16 [usertype] <noident> drivers/net/dnet.c:70:13: warning: incorrect type in assignment (different base types) drivers/net/dnet.c:70:13: expected unsigned short [unsigned] [usertype] tmp drivers/net/dnet.c:70:13: got restricted __be16 [usertype] <noident> drivers/net/dnet.c:92:27: warning: cast to restricted __be16 drivers/net/dnet.c:94:33: warning: cast to restricted __be16 drivers/net/dnet.c:96:33: warning: cast to restricted __be16 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dnet.c')
-rw-r--r--drivers/net/dnet.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c
index 7c075756611a..9d8a20b72fa9 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -27,7 +27,7 @@
27#undef DEBUG 27#undef DEBUG
28 28
29/* function for reading internal MAC register */ 29/* function for reading internal MAC register */
30u16 dnet_readw_mac(struct dnet *bp, u16 reg) 30static u16 dnet_readw_mac(struct dnet *bp, u16 reg)
31{ 31{
32 u16 data_read; 32 u16 data_read;
33 33
@@ -46,7 +46,7 @@ u16 dnet_readw_mac(struct dnet *bp, u16 reg)
46} 46}
47 47
48/* function for writing internal MAC register */ 48/* function for writing internal MAC register */
49void dnet_writew_mac(struct dnet *bp, u16 reg, u16 val) 49static void dnet_writew_mac(struct dnet *bp, u16 reg, u16 val)
50{ 50{
51 /* load data to write */ 51 /* load data to write */
52 dnet_writel(bp, val, MACREG_DATA); 52 dnet_writel(bp, val, MACREG_DATA);
@@ -63,11 +63,11 @@ static void __dnet_set_hwaddr(struct dnet *bp)
63{ 63{
64 u16 tmp; 64 u16 tmp;
65 65
66 tmp = cpu_to_be16(*((u16 *) bp->dev->dev_addr)); 66 tmp = be16_to_cpup((__be16 *)bp->dev->dev_addr);
67 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG, tmp); 67 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
68 tmp = cpu_to_be16(*((u16 *) (bp->dev->dev_addr + 2))); 68 tmp = be16_to_cpup((__be16 *)(bp->dev->dev_addr + 2));
69 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG, tmp); 69 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
70 tmp = cpu_to_be16(*((u16 *) (bp->dev->dev_addr + 4))); 70 tmp = be16_to_cpup((__be16 *)(bp->dev->dev_addr + 4));
71 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG, tmp); 71 dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
72} 72}
73 73
@@ -89,11 +89,11 @@ static void __devinit dnet_get_hwaddr(struct dnet *bp)
89 * Mac_addr[15:0]). 89 * Mac_addr[15:0]).
90 */ 90 */
91 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG); 91 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG);
92 *((u16 *) addr) = be16_to_cpu(tmp); 92 *((__be16 *)addr) = cpu_to_be16(tmp);
93 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG); 93 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG);
94 *((u16 *) (addr + 2)) = be16_to_cpu(tmp); 94 *((__be16 *)(addr + 2)) = cpu_to_be16(tmp);
95 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG); 95 tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG);
96 *((u16 *) (addr + 4)) = be16_to_cpu(tmp); 96 *((__be16 *)(addr + 4)) = cpu_to_be16(tmp);
97 97
98 if (is_valid_ether_addr(addr)) 98 if (is_valid_ether_addr(addr))
99 memcpy(bp->dev->dev_addr, addr, sizeof(addr)); 99 memcpy(bp->dev->dev_addr, addr, sizeof(addr));
@@ -361,7 +361,7 @@ err_out:
361} 361}
362 362
363/* For Neptune board: LINK1000 as Link LED and TX as activity LED */ 363/* For Neptune board: LINK1000 as Link LED and TX as activity LED */
364int dnet_phy_marvell_fixup(struct phy_device *phydev) 364static int dnet_phy_marvell_fixup(struct phy_device *phydev)
365{ 365{
366 return phy_write(phydev, 0x18, 0x4148); 366 return phy_write(phydev, 0x18, 0x4148);
367} 367}