aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2005-09-29 22:49:17 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-29 22:49:17 -0400
commita4199b0b9aa540a27935251de788cd0f5f5a87aa (patch)
tree7861be05cdcff1fd1cefd3f10b0980e3cfb6f207
parent9d30c1718b8baf9a3bb1b81d78afc1e667863477 (diff)
[CASSINI]: sparse annotations and fixes
- __user annotations - NULL noise removal - C99 initializers - s/u32/pm_message_t/ in ->suspend() - removal of bogus casts in iounmap() arguments - if_mii() instead of open-coded variant Remains to be done: ethtool conversion. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/cassini.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 69cb368247e7..45831fb377a0 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -3244,7 +3244,7 @@ static int cas_get_vpd_info(struct cas *cp, unsigned char *dev_addr,
3244 goto use_random_mac_addr; 3244 goto use_random_mac_addr;
3245 3245
3246 /* search for beginning of vpd */ 3246 /* search for beginning of vpd */
3247 base = 0; 3247 base = NULL;
3248 for (i = 2; i < EXPANSION_ROM_SIZE; i++) { 3248 for (i = 2; i < EXPANSION_ROM_SIZE; i++) {
3249 /* check for PCIR */ 3249 /* check for PCIR */
3250 if ((readb(p + i + 0) == 0x50) && 3250 if ((readb(p + i + 0) == 0x50) &&
@@ -4564,7 +4564,7 @@ static void cas_set_multicast(struct net_device *dev)
4564/* Eventually add support for changing the advertisement 4564/* Eventually add support for changing the advertisement
4565 * on autoneg. 4565 * on autoneg.
4566 */ 4566 */
4567static int cas_ethtool_ioctl(struct net_device *dev, void *ep_user) 4567static int cas_ethtool_ioctl(struct net_device *dev, void __user *ep_user)
4568{ 4568{
4569 struct cas *cp = netdev_priv(dev); 4569 struct cas *cp = netdev_priv(dev);
4570 u16 bmcr; 4570 u16 bmcr;
@@ -4578,7 +4578,7 @@ static int cas_ethtool_ioctl(struct net_device *dev, void *ep_user)
4578 4578
4579 switch(ecmd.cmd) { 4579 switch(ecmd.cmd) {
4580 case ETHTOOL_GDRVINFO: { 4580 case ETHTOOL_GDRVINFO: {
4581 struct ethtool_drvinfo info = { cmd: ETHTOOL_GDRVINFO }; 4581 struct ethtool_drvinfo info = { .cmd = ETHTOOL_GDRVINFO };
4582 4582
4583 strncpy(info.driver, DRV_MODULE_NAME, 4583 strncpy(info.driver, DRV_MODULE_NAME,
4584 ETHTOOL_BUSINFO_LEN); 4584 ETHTOOL_BUSINFO_LEN);
@@ -4738,7 +4738,7 @@ static int cas_ethtool_ioctl(struct net_device *dev, void *ep_user)
4738 4738
4739 /* get link status */ 4739 /* get link status */
4740 case ETHTOOL_GLINK: { 4740 case ETHTOOL_GLINK: {
4741 struct ethtool_value edata = { cmd: ETHTOOL_GLINK }; 4741 struct ethtool_value edata = { .cmd = ETHTOOL_GLINK };
4742 4742
4743 edata.data = (cp->lstate == link_up); 4743 edata.data = (cp->lstate == link_up);
4744 if (copy_to_user(ep_user, &edata, sizeof(edata))) 4744 if (copy_to_user(ep_user, &edata, sizeof(edata)))
@@ -4748,7 +4748,7 @@ static int cas_ethtool_ioctl(struct net_device *dev, void *ep_user)
4748 4748
4749 /* get message-level */ 4749 /* get message-level */
4750 case ETHTOOL_GMSGLVL: { 4750 case ETHTOOL_GMSGLVL: {
4751 struct ethtool_value edata = { cmd: ETHTOOL_GMSGLVL }; 4751 struct ethtool_value edata = { .cmd = ETHTOOL_GMSGLVL };
4752 4752
4753 edata.data = cp->msg_enable; 4753 edata.data = cp->msg_enable;
4754 if (copy_to_user(ep_user, &edata, sizeof(edata))) 4754 if (copy_to_user(ep_user, &edata, sizeof(edata)))
@@ -4874,7 +4874,7 @@ static int cas_ethtool_ioctl(struct net_device *dev, void *ep_user)
4874static int cas_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 4874static int cas_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
4875{ 4875{
4876 struct cas *cp = netdev_priv(dev); 4876 struct cas *cp = netdev_priv(dev);
4877 struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data; 4877 struct mii_ioctl_data *data = if_mii(ifr);
4878 unsigned long flags; 4878 unsigned long flags;
4879 int rc = -EOPNOTSUPP; 4879 int rc = -EOPNOTSUPP;
4880 4880
@@ -5168,7 +5168,7 @@ err_out_iounmap:
5168 cas_shutdown(cp); 5168 cas_shutdown(cp);
5169 up(&cp->pm_sem); 5169 up(&cp->pm_sem);
5170 5170
5171 iounmap((void *) cp->regs); 5171 iounmap(cp->regs);
5172 5172
5173 5173
5174err_out_free_res: 5174err_out_free_res:
@@ -5216,7 +5216,7 @@ static void __devexit cas_remove_one(struct pci_dev *pdev)
5216#endif 5216#endif
5217 pci_free_consistent(pdev, sizeof(struct cas_init_block), 5217 pci_free_consistent(pdev, sizeof(struct cas_init_block),
5218 cp->init_block, cp->block_dvma); 5218 cp->init_block, cp->block_dvma);
5219 iounmap((void *) cp->regs); 5219 iounmap(cp->regs);
5220 free_netdev(dev); 5220 free_netdev(dev);
5221 pci_release_regions(pdev); 5221 pci_release_regions(pdev);
5222 pci_disable_device(pdev); 5222 pci_disable_device(pdev);
@@ -5224,7 +5224,7 @@ static void __devexit cas_remove_one(struct pci_dev *pdev)
5224} 5224}
5225 5225
5226#ifdef CONFIG_PM 5226#ifdef CONFIG_PM
5227static int cas_suspend(struct pci_dev *pdev, u32 state) 5227static int cas_suspend(struct pci_dev *pdev, pm_message_t state)
5228{ 5228{
5229 struct net_device *dev = pci_get_drvdata(pdev); 5229 struct net_device *dev = pci_get_drvdata(pdev);
5230 struct cas *cp = netdev_priv(dev); 5230 struct cas *cp = netdev_priv(dev);