Skip to contentSkip to conversation

atm: lec use dev_change_mtu

PATCH Applied Stephen Hemminger 3 participants 6 messages Mar 20, 2009 – Mar 21, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atm: lec use dev_change_mtu

Rather than calling device pointer directly (which is incorrect with net_device_ops), use the standard dev_change_mtu. Compile tested only.

net/atm/lec.c +1 -1
@@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
 		priv->lane2_ops = NULL;
 		if (priv->lane_version > 1)
 			priv->lane2_ops = &lane2_ops;
-		if (dev->change_mtu(dev, mesg->content.config.mtu))
+		if (dev_set_mtu(dev, mesg->content.config.mtu))
 			printk("%s: change_mtu to %d failed\n", dev->name,
 			       mesg->content.config.mtu);
 		priv->is_proxy = mesg->content.config.is_proxy;
#1 lore raw
Quoted 2 lines · Stephen Hemminger

Rather than calling device pointer directly (which is incorrect with net_device_ops), use the standard dev_change_mtu. Compile tested only.

                                                             ^^^^^^^^^^^^Should it be dev_set_mtu?
Quoted 20 lines
net/atm/lec.c +1 -2
@@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
 		priv->lane2_ops = NULL;
 		if (priv->lane_version > 1)
 			priv->lane2_ops = &lane2_ops;
-		if (dev->change_mtu(dev, mesg->content.config.mtu))
+		if (dev_set_mtu(dev, mesg->content.config.mtu))
 			printk("%s: change_mtu to %d failed\n", dev->name,
 			       mesg->content.config.mtu);
 		priv->is_proxy = mesg->content.config.is_proxy;
--

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Regards
Yang Hongyang
#2 lore raw
In reply to Stephen Hemminger

net/atm/lec.c static int lec_atm_send(struct atm_vcc * · line 505

Quoted 13 lines · Stephen Hemminger

Rather than calling device pointer directly (which is incorrect with net_device_ops), use the standard dev_change_mtu. Compile tested only.

net/atm/lec.c +1 -1
@@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
 		priv->lane2_ops = NULL;
 		if (priv->lane_version > 1)
 			priv->lane2_ops = &lane2_ops;
-		if (dev->change_mtu(dev, mesg->content.config.mtu))
+		if (dev_set_mtu(dev, mesg->content.config.mtu))

I think it's not correct.This dev->change_mtu is:
663 static int lec_change_mtu(struct net_device *dev, int new_mtu) 664 {
665 if ((new_mtu < 68) || (new_mtu > 18190))
666 return -EINVAL;

 667         dev->mtu = new_mtu;
		^^^^^^^^^^^^^^^^maybe should use dev_set_mtu() here.

668 return 0;
669 }

and it's not quite same as dev_set_mtu.

Quoted 9 lines
net/atm/lec.c +0 -1
 			printk("%s: change_mtu to %d failed\n", dev->name,
 			       mesg->content.config.mtu);
 		priv->is_proxy = mesg->content.config.is_proxy;
--

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Regards
Yang Hongyang
maintainer
#3 lore raw

From: Yang Hongyang <[email protected]>
Date: Fri, 20 Mar 2009 15:45:20 +0800

Quoted 20 lines

net/atm/lec.c static int lec_atm_send(struct atm_vcc * · line 505

Quoted 13 lines · Stephen Hemminger

Rather than calling device pointer directly (which is incorrect with net_device_ops), use the standard dev_change_mtu. Compile tested only.

net/atm/lec.c +1 -1
@@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
 		priv->lane2_ops = NULL;
 		if (priv->lane_version > 1)
 			priv->lane2_ops = &lane2_ops;
-		if (dev->change_mtu(dev, mesg->content.config.mtu))
+		if (dev_set_mtu(dev, mesg->content.config.mtu))

I think it's not correct.This dev->change_mtu is:
663 static int lec_change_mtu(struct net_device *dev, int new_mtu) 664 {
665 if ((new_mtu < 68) || (new_mtu > 18190))
666 return -EINVAL;

Quoted 6 lines
 667         dev->mtu = new_mtu;
		^^^^^^^^^^^^^^^^maybe should use dev_set_mtu() here.

668 return 0;
669 }

and it's not quite same as dev_set_mtu.

dev_set_mtu() calls netdev->ops->ndo_set_mtu() so it will call this function you are quoting.

#4 lore raw
Quoted 27 lines · David Miller

From: Yang Hongyang <[email protected]>
Date: Fri, 20 Mar 2009 15:45:20 +0800

Quoted 24 lines

net/atm/lec.c static int lec_atm_send(struct atm_vcc * · line 505

Quoted 13 lines · Stephen Hemminger

Rather than calling device pointer directly (which is incorrect with net_device_ops), use the standard dev_change_mtu. Compile tested only.

net/atm/lec.c +1 -1
@@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
 		priv->lane2_ops = NULL;
 		if (priv->lane_version > 1)
 			priv->lane2_ops = &lane2_ops;
-		if (dev->change_mtu(dev, mesg->content.config.mtu))
+		if (dev_set_mtu(dev, mesg->content.config.mtu))

I think it's not correct.This dev->change_mtu is:
663 static int lec_change_mtu(struct net_device *dev, int new_mtu) 664 {
665 if ((new_mtu < 68) || (new_mtu > 18190))
666 return -EINVAL;

 667         dev->mtu = new_mtu;
		^^^^^^^^^^^^^^^^maybe should use dev_set_mtu() here.

668 return 0;
669 }

Quoted 4 lines
Quoted 1 line

and it's not quite same as dev_set_mtu.

dev_set_mtu() calls netdev->ops->ndo_set_mtu() so it will call this function you are quoting.

got it.:)

Quoted 2 lines
Signature · 2 lines
Regards
Yang Hongyang