Resolve warnings about unused variables when aliases are disabled

pull/10/head
Paul Hollinsky 2019-08-27 18:19:31 -04:00
parent 17569a82a9
commit 5031840429
1 changed files with 7 additions and 0 deletions

View File

@ -321,7 +321,10 @@ static int intrepid_remove_can_if(int index)
static int intrepid_add_can_if(struct intrepid_netdevice **result, const char *requestedName)
{
// The `requestedName` parameter is always NULL if KERNEL_SUPPORTS_ALIASES is false
#if KERNEL_SUPPORTS_ALIASES
size_t aliasLen = 0;
#endif
int i;
int ret = -EPERM;
struct net_device *dev = NULL;
@ -590,6 +593,7 @@ static long intrepid_dev_ioctl(struct file *fp, unsigned int cmd, unsigned long
switch (cmd) {
case SIOCSADDIF: {
struct intrepid_netdevice *result = NULL;
#if KERNEL_SUPPORTS_ALIASES
char requestedNameBuffer[IFALIASZ] = {0};
char* requestedName = NULL;
int bytesNotCopied = 0;
@ -600,6 +604,9 @@ static long intrepid_dev_ioctl(struct file *fp, unsigned int cmd, unsigned long
requestedName = requestedNameBuffer;
}
ret = intrepid_add_can_if(&result, requestedName);
#else
ret = intrepid_add_can_if(&result, NULL);
#endif
break;
}
case SIOCSREMOVEIF: