[U-Boot] [PATCH] net: change the env name to use const

As we don't modify the 'name' parameter, so change it to const.
Signed-off-by: Josh Wu josh.wu@atmel.com ---
include/net.h | 4 ++-- net/eth.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net.h b/include/net.h index d09bec9..133fee4 100644 --- a/include/net.h +++ b/include/net.h @@ -229,8 +229,8 @@ void eth_set_current(void); /* set nterface to ethcur var */
int eth_get_dev_index(void); /* get the device index */ void eth_parse_enetaddr(const char *addr, uchar *enetaddr); -int eth_getenv_enetaddr(char *name, uchar *enetaddr); -int eth_setenv_enetaddr(char *name, const uchar *enetaddr); +int eth_getenv_enetaddr(const char *name, uchar *enetaddr); +int eth_setenv_enetaddr(const char *name, const uchar *enetaddr);
/* * Get the hardware address for an ethernet interface . diff --git a/net/eth.c b/net/eth.c index d3ec8d6..8e146d2 100644 --- a/net/eth.c +++ b/net/eth.c @@ -31,13 +31,13 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr) } }
-int eth_getenv_enetaddr(char *name, uchar *enetaddr) +int eth_getenv_enetaddr(const char *name, uchar *enetaddr) { eth_parse_enetaddr(getenv(name), enetaddr); return is_valid_ethaddr(enetaddr); }
-int eth_setenv_enetaddr(char *name, const uchar *enetaddr) +int eth_setenv_enetaddr(const char *name, const uchar *enetaddr) { char buf[20];

On 1 September 2015 at 04:22, Josh Wu josh.wu@atmel.com wrote:
As we don't modify the 'name' parameter, so change it to const.
Signed-off-by: Josh Wu josh.wu@atmel.com
include/net.h | 4 ++-- net/eth.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Tue, Sep 1, 2015 at 5:22 AM, Josh Wu josh.wu@atmel.com wrote:
As we don't modify the 'name' parameter, so change it to const.
Signed-off-by: Josh Wu josh.wu@atmel.com
Acked-by: Joe Hershberger joe.hershberger@ni.com

Hi, Joe
On 9/4/2015 11:34 PM, Joe Hershberger wrote:
On Tue, Sep 1, 2015 at 5:22 AM, Josh Wu josh.wu@atmel.com wrote:
As we don't modify the 'name' parameter, so change it to const.
Signed-off-by: Josh Wu josh.wu@atmel.com
Acked-by: Joe Hershberger joe.hershberger@ni.com
Thanks for the Ack. It seems I didn't see this patch in your git tree, or I missed something?
Best Regards, Josh Wu

On Tue, Sep 1, 2015 at 5:22 AM, Josh Wu josh.wu@atmel.com wrote:
As we don't modify the 'name' parameter, so change it to const.
Signed-off-by: Josh Wu josh.wu@atmel.com
Applied to u-boot-net/master, thanks! -Joe
participants (3)
-
Joe Hershberger
-
Josh Wu
-
Simon Glass