9
0
Fork 0

net: Make set_ethaddr argument const

The set_ethaddr callback should not modify the MAC address passed to it, so
make it const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2015-06-26 11:55:05 +02:00
parent 3b6a1db325
commit 1dd5262eb9
28 changed files with 28 additions and 28 deletions

View File

@ -231,7 +231,7 @@ static int tse_get_ethaddr(struct eth_device *edev, unsigned char *m)
return 0;
}
static int tse_set_ethaddr(struct eth_device *edev, unsigned char *m)
static int tse_set_ethaddr(struct eth_device *edev, const unsigned char *m)
{
struct altera_tse_priv *priv = edev->priv;
struct alt_tse_mac *mac_dev = priv->tse_regs;

View File

@ -70,7 +70,7 @@ static void ar231x_reset_bit_(struct ar231x_eth_priv *priv,
(*priv->reset_bit)(val, state);
}
static int ar231x_set_ethaddr(struct eth_device *edev, unsigned char *addr);
static int ar231x_set_ethaddr(struct eth_device *edev, const unsigned char *addr);
static void ar231x_reset_regs(struct eth_device *edev)
{
struct ar231x_eth_priv *priv = edev->priv;

View File

@ -332,7 +332,7 @@ static int arc_emac_get_ethaddr(struct eth_device *edev, unsigned char *mac)
return -1;
}
static int arc_emac_set_ethaddr(struct eth_device *edev, unsigned char *mac)
static int arc_emac_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct arc_emac_priv *priv = edev->priv;
unsigned int addr_low, addr_hi;

View File

@ -261,7 +261,7 @@ static int at91_ether_get_ethaddr(struct eth_device *eth, unsigned char *adr)
return -1;
}
static int at91_ether_set_ethaddr(struct eth_device *eth, unsigned char *adr)
static int at91_ether_set_ethaddr(struct eth_device *eth, const unsigned char *adr)
{
int i;

View File

@ -547,7 +547,7 @@ static int cpsw_get_hwaddr(struct eth_device *edev, unsigned char *mac)
return -1;
}
static int cpsw_set_hwaddr(struct eth_device *edev, unsigned char *mac)
static int cpsw_set_hwaddr(struct eth_device *edev, const unsigned char *mac)
{
struct cpsw_slave *slave = edev->priv;
struct cpsw_priv *priv = slave->cpsw;

View File

@ -341,7 +341,7 @@ static int cs8900_get_ethaddr(struct eth_device *dev, unsigned char *mac)
return 0;
}
static int cs8900_set_ethaddr(struct eth_device *dev, unsigned char *mac)
static int cs8900_set_ethaddr(struct eth_device *dev, const unsigned char *mac)
{
struct cs8900_priv *priv = (struct cs8900_priv *)dev->priv;
int i;

View File

@ -178,7 +178,7 @@ static int davinci_emac_get_ethaddr(struct eth_device *edev, unsigned char *adr)
* This function must be called before emac_open() if you want to override
* the default mac address.
*/
static int davinci_emac_set_ethaddr(struct eth_device *edev, unsigned char *addr)
static int davinci_emac_set_ethaddr(struct eth_device *edev, const unsigned char *addr)
{
struct davinci_emac_priv *priv = edev->priv;
int i;

View File

@ -384,7 +384,7 @@ static int dwc_ether_get_ethaddr(struct eth_device *dev, u8 adr[6])
return -1;
}
static int dwc_ether_set_ethaddr(struct eth_device *dev, u8 adr[6])
static int dwc_ether_set_ethaddr(struct eth_device *dev, const unsigned char *adr)
{
struct dw_eth_dev *priv = dev->priv;
struct eth_mac_regs *mac_p = priv->mac_regs_p;

View File

@ -711,7 +711,7 @@ static int dm9k_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return 0;
}
static int dm9k_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int dm9k_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct dm9k *priv = (struct dm9k *)edev->priv;
int i, oft;

View File

@ -466,7 +466,7 @@ static int ep93xx_eth_get_ethaddr(struct eth_device *edev,
}
static int ep93xx_eth_set_ethaddr(struct eth_device *edev,
unsigned char *mac_addr)
const unsigned char *mac_addr)
{
struct mac_regs *regs = ep93xx_get_regs(edev);

View File

@ -435,7 +435,7 @@ static int ethoc_get_ethaddr(struct eth_device *edev, unsigned char *mac)
return 0;
}
static int ethoc_set_ethaddr(struct eth_device *edev, unsigned char *mac)
static int ethoc_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct ethoc *dev = edev->priv;

View File

@ -249,7 +249,7 @@ static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
return -1;
}
static int fec_set_hwaddr(struct eth_device *dev, unsigned char *mac)
static int fec_set_hwaddr(struct eth_device *dev, const unsigned char *mac)
{
struct fec_priv *fec = (struct fec_priv *)dev->priv;

View File

@ -211,7 +211,7 @@ static int mpc5xxx_fec_get_ethaddr(struct eth_device *dev, unsigned char *mac)
return -1;
}
static int mpc5xxx_fec_set_ethaddr(struct eth_device *dev, unsigned char *mac)
static int mpc5xxx_fec_set_ethaddr(struct eth_device *dev, const unsigned char *mac)
{
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
uint8_t currByte; /* byte for which to compute the CRC */

View File

@ -233,7 +233,7 @@ static int gfar_get_ethaddr(struct eth_device *edev, unsigned char *mac)
return -ENODEV;
}
static int gfar_set_ethaddr(struct eth_device *edev, unsigned char *mac)
static int gfar_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct gfar_private *priv = edev->priv;
void __iomem *regs = priv->regs;

View File

@ -571,7 +571,7 @@ static int ks8851_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return 0;
}
static int ks8851_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int ks8851_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct ks_net *priv = (struct ks_net *)edev->priv;

View File

@ -493,7 +493,7 @@ static int macb_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return -1;
}
static int macb_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int macb_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct macb_device *macb = edev->priv;

View File

@ -486,7 +486,7 @@ recv_err:
return ret;
}
static int mvneta_set_ethaddr(struct eth_device *edev, unsigned char *mac)
static int mvneta_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct mvneta_port *priv = edev->priv;
u32 mac_h = (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3];

View File

@ -210,7 +210,7 @@ static int netx_eth_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return -1;
}
static int netx_eth_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int netx_eth_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct netx_eth_priv *priv = (struct netx_eth_priv *)edev->priv;
int xcno = priv->xcno;

View File

@ -322,7 +322,7 @@ recv_err:
return ret;
}
static int port_set_ethaddr(struct eth_device *edev, unsigned char *mac)
static int port_set_ethaddr(struct eth_device *edev, const unsigned char *mac)
{
struct port_priv *port = edev->priv;
u32 mac_h = (mac[0] << 24) | (mac[1] << 16) | (mac[2] << 8) | mac[3];

View File

@ -352,7 +352,7 @@ static int rtl8139_get_ethaddr(struct eth_device *edev, unsigned char *m)
}
static int rtl8139_set_ethaddr(struct eth_device *edev,
unsigned char *mac_addr)
const unsigned char *mac_addr)
{
struct rtl8139_priv *priv = edev->priv;
int i;

View File

@ -456,7 +456,7 @@ static int rtl8169_get_ethaddr(struct eth_device *edev, unsigned char *m)
return 0;
}
static int rtl8169_set_ethaddr(struct eth_device *edev, unsigned char *mac_addr)
static int rtl8169_set_ethaddr(struct eth_device *edev, const unsigned char *mac_addr)
{
struct rtl8169_priv *priv = edev->priv;
int i;

View File

@ -1378,7 +1378,7 @@ static int smc91c111_get_ethaddr(struct eth_device *edev, unsigned char *m)
}
static int smc91c111_set_ethaddr(struct eth_device *edev,
unsigned char *mac_addr)
const unsigned char *mac_addr)
{
struct smc91c111_priv *priv = (struct smc91c111_priv *)edev->priv;
unsigned address;

View File

@ -182,7 +182,7 @@ static int smc911x_get_ethaddr(struct eth_device *edev, unsigned char *m)
return 0;
}
static int smc911x_set_ethaddr(struct eth_device *edev, unsigned char *m)
static int smc911x_set_ethaddr(struct eth_device *edev, const unsigned char *m)
{
unsigned long addrh, addrl;

View File

@ -65,7 +65,7 @@ static int tap_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return -1;
}
static int tap_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int tap_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
return 0;
}

View File

@ -403,7 +403,7 @@ static int asix_get_ethaddr(struct eth_device *edev, unsigned char *adr)
return 0;
}
static int asix_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int asix_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
/* not possible? */
return 0;

View File

@ -363,7 +363,7 @@ static int smsc95xx_set_csums(struct usbnet *dev)
return 0;
}
static int smsc95xx_set_ethaddr(struct eth_device *edev, unsigned char *adr)
static int smsc95xx_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct usbnet *udev = container_of(edev, struct usbnet, edev);

View File

@ -674,7 +674,7 @@ static int xgmac_get_ethaddr(struct eth_device *edev, unsigned char *addr)
return 0;
}
static int xgmac_set_ethaddr(struct eth_device *dev, unsigned char *addr)
static int xgmac_set_ethaddr(struct eth_device *dev, const unsigned char *addr)
{
struct xgmac_priv *priv = dev->priv;
u32 data;

View File

@ -42,7 +42,7 @@ struct eth_device {
int (*recv) (struct eth_device*);
void (*halt) (struct eth_device*);
int (*get_ethaddr) (struct eth_device*, u8 adr[6]);
int (*set_ethaddr) (struct eth_device*, u8 adr[6]);
int (*set_ethaddr) (struct eth_device*, const unsigned char *adr);
struct eth_device *next;
void *priv;