aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/lp486e.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-07 23:30:35 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-12 14:38:58 -0500
commit4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch)
tree99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net/lp486e.c
parent8e5574211d96c0552f84c757718475fdb4021be7 (diff)
net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/lp486e.c')
-rw-r--r--drivers/net/lp486e.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c
index e20fefc73c8b..b1f5d79af61f 100644
--- a/drivers/net/lp486e.c
+++ b/drivers/net/lp486e.c
@@ -1253,18 +1253,19 @@ static void set_multicast_list(struct net_device *dev) {
1253 1253
1254 if (i596_debug > 1) 1254 if (i596_debug > 1)
1255 printk ("%s: set multicast list %d\n", 1255 printk ("%s: set multicast list %d\n",
1256 dev->name, dev->mc_count); 1256 dev->name, netdev_mc_count(dev));
1257 1257
1258 if (dev->mc_count > 0) { 1258 if (!netdev_mc_empty(dev)) {
1259 struct dev_mc_list *dmi; 1259 struct dev_mc_list *dmi;
1260 char *cp; 1260 char *cp;
1261 cmd = kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC); 1261 cmd = kmalloc(sizeof(struct i596_cmd) + 2 +
1262 netdev_mc_count(dev) * 6, GFP_ATOMIC);
1262 if (cmd == NULL) { 1263 if (cmd == NULL) {
1263 printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name); 1264 printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name);
1264 return; 1265 return;
1265 } 1266 }
1266 cmd->command = CmdMulticastList; 1267 cmd->command = CmdMulticastList;
1267 *((unsigned short *) (cmd + 1)) = dev->mc_count * 6; 1268 *((unsigned short *) (cmd + 1)) = netdev_mc_count(dev) * 6;
1268 cp = ((char *)(cmd + 1))+2; 1269 cp = ((char *)(cmd + 1))+2;
1269 for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { 1270 for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) {
1270 memcpy(cp, dmi,6); 1271 memcpy(cp, dmi,6);
@@ -1277,7 +1278,8 @@ static void set_multicast_list(struct net_device *dev) {
1277 if (lp->set_conf.pa_next != I596_NULL) { 1278 if (lp->set_conf.pa_next != I596_NULL) {
1278 return; 1279 return;
1279 } 1280 }
1280 if (dev->mc_count == 0 && !(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) { 1281 if (netdev_mc_empty(dev) &&
1282 !(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) {
1281 lp->i596_config[8] &= ~0x01; 1283 lp->i596_config[8] &= ~0x01;
1282 } else { 1284 } else {
1283 lp->i596_config[8] |= 0x01; 1285 lp->i596_config[8] |= 0x01;