summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-12-11 19:56:27 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-12-14 11:40:45 +0100
commit7065fa32cac8af222bffc2ce9256931beaa2acfc (patch)
tree0c06ffd7443d43e50cbcdec67974ad1ecf933e92
parent802d8fdfbe0afbb76f4a6dc862d12aa422f42520 (diff)
downloadbarebox-7065fa32cac8af222bffc2ce9256931beaa2acfc.tar.gz
net: dhcp: make unmodified variable const
'str' in dhcp_set_string_options is never modified, so make it const. With this we no longer have to cast away the const returned from getenv. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--net/dhcp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/dhcp.c b/net/dhcp.c
index 78e5fe0..4433b44 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -204,13 +204,13 @@ static void bootfile_vendorex_handle(struct dhcp_opt *opt, unsigned char *popt,
static int dhcp_set_string_options(struct dhcp_opt *param, u8 *e)
{
int str_len;
- char* str = param->data;
+ const char *str = param->data;
if (!str && param->barebox_var_name && IS_ENABLED(CONFIG_ENVIRONMENT_VARIABLES))
- str = (char*)getenv(param->barebox_var_name);
+ str = getenv(param->barebox_var_name);
if (!str && param->barebox_dhcp_global && IS_ENABLED(CONFIG_GLOBALVAR))
- str = (char*)dhcp_get_barebox_global(param->barebox_dhcp_global);
+ str = dhcp_get_barebox_global(param->barebox_dhcp_global);
if (!str)
return 0;