Skip to content

Commit

Permalink
hsr: remove unnecessary code in hsr_dev_change_mtu()
Browse files Browse the repository at this point in the history
In the hsr_dev_change_mtu(), the 'dev' and 'master->dev' pointer are
same. So, the 'master' variable and some code are unnecessary.

Signed-off-by: Taehee Yoo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
TaeheeYoo authored and davem330 committed Apr 26, 2020
1 parent 071c8ed commit f30e472
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/hsr/hsr_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,11 @@ int hsr_get_max_mtu(struct hsr_priv *hsr)
static int hsr_dev_change_mtu(struct net_device *dev, int new_mtu)
{
struct hsr_priv *hsr;
struct hsr_port *master;

hsr = netdev_priv(dev);
master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);

if (new_mtu > hsr_get_max_mtu(hsr)) {
netdev_info(master->dev, "A HSR master's MTU cannot be greater than the smallest MTU of its slaves minus the HSR Tag length (%d octets).\n",
netdev_info(dev, "A HSR master's MTU cannot be greater than the smallest MTU of its slaves minus the HSR Tag length (%d octets).\n",
HSR_HLEN);
return -EINVAL;
}
Expand Down

0 comments on commit f30e472

Please sign in to comment.