netif: clean up remaining index shadowing from if APIs

This commit cleans up the remaining instance of global variable
"index" shadowing caused by using local variables and function
parameters named "index"

These were introduced in the recent interface index API commits
This commit is contained in:
Joel Cunningham 2017-01-23 17:21:43 -06:00
parent d297d466ed
commit fbfe987ae8
2 changed files with 4 additions and 4 deletions

View File

@ -1302,14 +1302,14 @@ netif_name_to_index(const char *name)
* @param name char buffer of at least IF_NAMESIZE bytes
*/
char *
netif_index_to_name(u8_t index, char *name)
netif_index_to_name(u8_t idx, char *name)
{
struct netif *curif = netif_list;
u8_t num;
if (index == 0) {
if (idx == 0) {
return NULL; /* indexes start at 1 */
}
num = netif_index_to_num(index);
num = netif_index_to_num(idx);
/* find netif from num */
while (curif != NULL) {

View File

@ -492,7 +492,7 @@ err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t
/* @ingroup netif */
u8_t netif_name_to_index(const char *name);
char * netif_index_to_name(u8_t index, char *name);
char * netif_index_to_name(u8_t idx, char *name);
/* Interface indexes always start at 1 per RFC 3493, section 4, num starts at 0 */
#define netif_num_to_index(netif) ((netif)->num + 1)