aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_main.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-22 13:56:23 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:10:30 -0500
commit05e5c1165393a2d6044b01288f089d2e74a49d58 (patch)
treebab583a44c814d4daf3cd2e617a1f3a52ee1c7a9 /drivers/net/cxgb3/cxgb3_main.c
parentac390c60a833192e87fb09ed8d67f5d1a84306c8 (diff)
annotate cxgb3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 0e3dcbff002d..fd2e05bbb903 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -1642,7 +1642,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
1642 1642
1643 e->magic = EEPROM_MAGIC; 1643 e->magic = EEPROM_MAGIC;
1644 for (i = e->offset & ~3; !err && i < e->offset + e->len; i += 4) 1644 for (i = e->offset & ~3; !err && i < e->offset + e->len; i += 4)
1645 err = t3_seeprom_read(adapter, i, (u32 *) & buf[i]); 1645 err = t3_seeprom_read(adapter, i, (__le32 *) & buf[i]);
1646 1646
1647 if (!err) 1647 if (!err)
1648 memcpy(data, buf + e->offset, e->len); 1648 memcpy(data, buf + e->offset, e->len);
@@ -1655,7 +1655,8 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
1655{ 1655{
1656 struct port_info *pi = netdev_priv(dev); 1656 struct port_info *pi = netdev_priv(dev);
1657 struct adapter *adapter = pi->adapter; 1657 struct adapter *adapter = pi->adapter;
1658 u32 aligned_offset, aligned_len, *p; 1658 u32 aligned_offset, aligned_len;
1659 __le32 *p;
1659 u8 *buf; 1660 u8 *buf;
1660 int err; 1661 int err;
1661 1662
@@ -1669,11 +1670,11 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
1669 buf = kmalloc(aligned_len, GFP_KERNEL); 1670 buf = kmalloc(aligned_len, GFP_KERNEL);
1670 if (!buf) 1671 if (!buf)
1671 return -ENOMEM; 1672 return -ENOMEM;
1672 err = t3_seeprom_read(adapter, aligned_offset, (u32 *) buf); 1673 err = t3_seeprom_read(adapter, aligned_offset, (__le32 *) buf);
1673 if (!err && aligned_len > 4) 1674 if (!err && aligned_len > 4)
1674 err = t3_seeprom_read(adapter, 1675 err = t3_seeprom_read(adapter,
1675 aligned_offset + aligned_len - 4, 1676 aligned_offset + aligned_len - 4,
1676 (u32 *) & buf[aligned_len - 4]); 1677 (__le32 *) & buf[aligned_len - 4]);
1677 if (err) 1678 if (err)
1678 goto out; 1679 goto out;
1679 memcpy(buf + (eeprom->offset & 3), data, eeprom->len); 1680 memcpy(buf + (eeprom->offset & 3), data, eeprom->len);
@@ -1684,7 +1685,7 @@ static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
1684 if (err) 1685 if (err)
1685 goto out; 1686 goto out;
1686 1687
1687 for (p = (u32 *) buf; !err && aligned_len; aligned_len -= 4, p++) { 1688 for (p = (__le32 *) buf; !err && aligned_len; aligned_len -= 4, p++) {
1688 err = t3_seeprom_write(adapter, aligned_offset, *p); 1689 err = t3_seeprom_write(adapter, aligned_offset, *p);
1689 aligned_offset += 4; 1690 aligned_offset += 4;
1690 } 1691 }