Skip to content

Commit

Permalink
Fix compile warnings for const correctness
Browse files Browse the repository at this point in the history
Commit 6e37b1a3a25004d3df5867de49fff6b3fc9c4f04 modifies several net calls
to take a (const char *) parameter instead of (char *), but in some cases
the modified functions call other functions taking (char *).  The end result
is warnings about discarding the const qualifier.

This patch fixes these other function signatures.

Signed-off-by: Ben Warren <[email protected]>
  • Loading branch information
ben-skyportsystems committed Aug 9, 2010
1 parent ede16ea commit d7fb9bc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/net/at91_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int at91emac_write(at91_emac_t *at91mac, unsigned char addr,

#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)

at91_emac_t *get_emacbase_by_name(char *devname)
at91_emac_t *get_emacbase_by_name(const char *devname)
{
struct eth_device *netdev;

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/eepro100.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ static int set_phyreg (struct eth_device *dev, unsigned char addr,
/* Check if given phyaddr is valid, i.e. there is a PHY connected.
* Do this by checking model value field from ID2 register.
*/
static struct eth_device* verify_phyaddr (char *devname, unsigned char addr)
static struct eth_device* verify_phyaddr (const char *devname,
unsigned char addr)
{
struct eth_device *dev;
unsigned short value;
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/phy/miiphybb.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void bb_miiphy_init(void)
}
}

static inline struct bb_miiphy_bus *bb_miiphy_getbus(char *devname)
static inline struct bb_miiphy_bus *bb_miiphy_getbus(const char *devname)
{
#ifdef CONFIG_BITBANGMII_MULTI
int i;
Expand Down Expand Up @@ -246,7 +246,7 @@ static void miiphy_pre(struct bb_miiphy_bus *bus, char read,
* Returns:
* 0 on success
*/
int bb_miiphy_read(char *devname, unsigned char addr,
int bb_miiphy_read(const char *devname, unsigned char addr,
unsigned char reg, unsigned short *value)
{
short rdreg; /* register working value */
Expand Down Expand Up @@ -327,7 +327,7 @@ int bb_miiphy_read(char *devname, unsigned char addr,
* Returns:
* 0 on success
*/
int bb_miiphy_write (char *devname, unsigned char addr,
int bb_miiphy_write (const char *devname, unsigned char addr,
unsigned char reg, unsigned short value)
{
struct bb_miiphy_bus *bus;
Expand Down
2 changes: 1 addition & 1 deletion include/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extern void eth_try_another(int first_restart); /* Change the device */
extern void eth_set_current(void); /* set nterface to ethcur var */
#endif
extern struct eth_device *eth_get_dev(void); /* get the current device MAC */
extern struct eth_device *eth_get_dev_by_name(char *devname); /* get device */
extern struct eth_device *eth_get_dev_by_name(const char *devname);
extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */
extern int eth_get_dev_index (void); /* get the device index */
extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
Expand Down
2 changes: 1 addition & 1 deletion net/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct eth_device *eth_get_dev(void)
return eth_current;
}

struct eth_device *eth_get_dev_by_name(char *devname)
struct eth_device *eth_get_dev_by_name(const char *devname)
{
struct eth_device *dev, *target_dev;

Expand Down

0 comments on commit d7fb9bc

Please sign in to comment.