Fix address evaluates always as true warnings

This was an example of a compiler warning when the switch -Waddress was passed:

atmel_softpack_libraries/usb/device/core/USBD.c: In function 'USBD_RequestHandler':
atmel_softpack_libraries/usb/device/core/USBD.c:149:14: warning: the address of
    'USBDCallbacks_RequestReceived' will always evaluate as 'true' [-Waddress]
     else if (USBDCallbacks_RequestReceived) {

The test for existense of USBDCallbacks_RequestReceived is removed since there
is always a default implementation of these function.
This commit is contained in:
Christina Quast 2015-01-27 14:27:38 +01:00
parent 2021077a66
commit f9890d91d3
1 changed files with 4 additions and 7 deletions

View File

@ -91,8 +91,7 @@ void USBD_SuspendHandler(void)
USBD_HAL_Suspend();
/* Invoke the User Suspended callback (Suspend System?) */
if (USBDCallbacks_Suspended)
USBDCallbacks_Suspended();
USBDCallbacks_Suspended();
}
}
@ -130,8 +129,7 @@ void USBD_ResetHandler()
USBD_HAL_ResetEPs(0xFFFFFFFF, USBD_STATUS_RESET, 0);
USBD_ConfigureEndpoint(0);
/* Invoke the Reset callback */
if (USBDCallbacks_Reset)
USBDCallbacks_Reset();
USBDCallbacks_Reset();
}
/**
@ -148,7 +146,7 @@ void USBD_RequestHandler(uint8_t bEndpoint,
TRACE_WARNING("EP%d request not supported, default EP only",
bEndpoint);
}
else if (USBDCallbacks_RequestReceived) {
else {
USBDCallbacks_RequestReceived(pRequest);
}
}
@ -365,8 +363,7 @@ void USBD_Init(void)
previousDeviceState = USBD_STATE_POWERED;
/* Upper Layer Initialize */
if (USBDCallbacks_Initialized)
USBDCallbacks_Initialized();
USBDCallbacks_Initialized();
TRACE_DEBUG("%s\n\r", "..");
}