From 3e0aa2f449f2ca42d7f41f96ba6b69ef20cdbfad Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sun, 3 Jan 2016 14:46:19 +0000 Subject: [PATCH] Eliminate code for walking through the early static env data. This code is called from a device attach routine, and thus cannot be called before the cutover from static to dynamic kernel env. --- sys/dev/rt/if_rt.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/sys/dev/rt/if_rt.c b/sys/dev/rt/if_rt.c index 4deb8deccfdb..3d3a3f35623a 100644 --- a/sys/dev/rt/if_rt.c +++ b/sys/dev/rt/if_rt.c @@ -227,20 +227,6 @@ macaddr_atoi(const char *str, uint8_t *mac) } #ifdef USE_GENERATED_MAC_ADDRESS -static char * -kernenv_next(char *cp) -{ - - if (cp != NULL) { - while (*cp != 0) - cp++; - cp++; - if (*cp == 0) - cp = NULL; - } - return (cp); -} - /* * generate_mac(uin8_t *mac) * This is MAC address generator for cases when real device MAC address @@ -259,14 +245,8 @@ generate_mac(uint8_t *mac) uint32_t crc = 0xffffffff; /* Generate CRC32 on kenv */ - if (dynamic_kenv) { - for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } - } else { - for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } + for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { + crc = calculate_crc32c(crc, cp, strlen(cp) + 1); } crc = ~crc;