Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: rename ATU MAC accessors
Browse files Browse the repository at this point in the history
Rename the __mv88e6xxx_{read,write}_addr functions to more explicit
_mv88e6xxx_atu_mac_{read,write} functions, which also respect the single
underscore convention used in the file (meaning SMI lock must be held).

In the meantime, define their MAC address parameters as an array of
ETH_ALEN bytes instead of a char pointer.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vivien Didelot authored and David S. Miller committed Aug 10, 2015
1 parent 368b1d9 commit 395059f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,8 @@ int mv88e6xxx_port_stp_update(struct dsa_switch *ds, int port, u8 state)
return 0;
}

static int __mv88e6xxx_write_addr(struct dsa_switch *ds,
const unsigned char *addr)
static int _mv88e6xxx_atu_mac_write(struct dsa_switch *ds,
const u8 addr[ETH_ALEN])
{
int i, ret;

Expand All @@ -1198,7 +1198,7 @@ static int __mv88e6xxx_write_addr(struct dsa_switch *ds,
return 0;
}

static int __mv88e6xxx_read_addr(struct dsa_switch *ds, unsigned char *addr)
static int _mv88e6xxx_atu_mac_read(struct dsa_switch *ds, u8 addr[ETH_ALEN])
{
int i, ret;

Expand All @@ -1225,7 +1225,7 @@ static int __mv88e6xxx_port_fdb_cmd(struct dsa_switch *ds, int port,
if (ret < 0)
return ret;

ret = __mv88e6xxx_write_addr(ds, addr);
ret = _mv88e6xxx_atu_mac_write(ds, addr);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -1280,7 +1280,7 @@ static int __mv88e6xxx_port_getnext(struct dsa_switch *ds, int port,
if (ret < 0)
return ret;

ret = __mv88e6xxx_write_addr(ds, addr);
ret = _mv88e6xxx_atu_mac_write(ds, addr);
if (ret < 0)
return ret;

Expand All @@ -1297,7 +1297,7 @@ static int __mv88e6xxx_port_getnext(struct dsa_switch *ds, int port,
return -ENOENT;
} while (!(((ret >> 4) & 0xff) & (1 << port)));

ret = __mv88e6xxx_read_addr(ds, addr);
ret = _mv88e6xxx_atu_mac_read(ds, addr);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -1659,7 +1659,7 @@ static int mv88e6xxx_atu_show_db(struct seq_file *s, struct dsa_switch *ds,
unsigned char addr[6];
int ret, data, state;

ret = __mv88e6xxx_write_addr(ds, bcast);
ret = _mv88e6xxx_atu_mac_write(ds, bcast);
if (ret < 0)
return ret;

Expand All @@ -1674,7 +1674,7 @@ static int mv88e6xxx_atu_show_db(struct seq_file *s, struct dsa_switch *ds,
state = data & GLOBAL_ATU_DATA_STATE_MASK;
if (state == GLOBAL_ATU_DATA_STATE_UNUSED)
break;
ret = __mv88e6xxx_read_addr(ds, addr);
ret = _mv88e6xxx_atu_mac_read(ds, addr);
if (ret < 0)
return ret;
mv88e6xxx_atu_show_entry(s, dbnum, addr, data);
Expand Down

0 comments on commit 395059f

Please sign in to comment.