mirror of https://gerrit.osmocom.org/simtrace2
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:
parent
2021077a66
commit
79c2b72c7a
|
@ -91,8 +91,7 @@ void USBD_SuspendHandler(void)
|
||||||
USBD_HAL_Suspend();
|
USBD_HAL_Suspend();
|
||||||
|
|
||||||
/* Invoke the User Suspended callback (Suspend System?) */
|
/* Invoke the User Suspended callback (Suspend System?) */
|
||||||
if (USBDCallbacks_Suspended)
|
USBDCallbacks_Suspended();
|
||||||
USBDCallbacks_Suspended();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,8 +108,7 @@ void USBD_ResumeHandler(void)
|
||||||
deviceState = previousDeviceState;
|
deviceState = previousDeviceState;
|
||||||
if (deviceState >= USBD_STATE_DEFAULT) {
|
if (deviceState >= USBD_STATE_DEFAULT) {
|
||||||
/* Invoke the Resume callback */
|
/* Invoke the Resume callback */
|
||||||
if (USBDCallbacks_Resumed)
|
USBDCallbacks_Resumed();
|
||||||
USBDCallbacks_Resumed();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,8 +128,7 @@ void USBD_ResetHandler()
|
||||||
USBD_HAL_ResetEPs(0xFFFFFFFF, USBD_STATUS_RESET, 0);
|
USBD_HAL_ResetEPs(0xFFFFFFFF, USBD_STATUS_RESET, 0);
|
||||||
USBD_ConfigureEndpoint(0);
|
USBD_ConfigureEndpoint(0);
|
||||||
/* Invoke the Reset callback */
|
/* Invoke the Reset callback */
|
||||||
if (USBDCallbacks_Reset)
|
USBDCallbacks_Reset();
|
||||||
USBDCallbacks_Reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,7 +145,7 @@ void USBD_RequestHandler(uint8_t bEndpoint,
|
||||||
TRACE_WARNING("EP%d request not supported, default EP only",
|
TRACE_WARNING("EP%d request not supported, default EP only",
|
||||||
bEndpoint);
|
bEndpoint);
|
||||||
}
|
}
|
||||||
else if (USBDCallbacks_RequestReceived) {
|
else {
|
||||||
USBDCallbacks_RequestReceived(pRequest);
|
USBDCallbacks_RequestReceived(pRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -365,8 +362,7 @@ void USBD_Init(void)
|
||||||
previousDeviceState = USBD_STATE_POWERED;
|
previousDeviceState = USBD_STATE_POWERED;
|
||||||
|
|
||||||
/* Upper Layer Initialize */
|
/* Upper Layer Initialize */
|
||||||
if (USBDCallbacks_Initialized)
|
USBDCallbacks_Initialized();
|
||||||
USBDCallbacks_Initialized();
|
|
||||||
TRACE_DEBUG("%s\n\r", "..");
|
TRACE_DEBUG("%s\n\r", "..");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue