Remove `statement is unreachable` warning in MbedCRC.h

The code removed appears unnecessary given that the switch case below
also handles the case where the polynomial is `POLY_32BIT_REV_ANSI`
pull/11478/head
Hugues Kamba 2019-09-12 15:57:32 +01:00
parent 01bb1b94d7
commit 5bfb5bf269
1 changed files with 12 additions and 15 deletions

View File

@ -514,22 +514,19 @@ private:
MBED_STATIC_ASSERT(width <= 32, "Max 32-bit CRC supported");
#if DEVICE_CRC
if (POLY_32BIT_REV_ANSI == polynomial) {
_crc_table = (uint32_t *)Table_CRC_32bit_Rev_ANSI;
_mode = TABLE;
return;
}
crc_mbed_config_t config;
config.polynomial = polynomial;
config.width = width;
config.initial_xor = _initial_value;
config.final_xor = _final_xor;
config.reflect_in = _reflect_data;
config.reflect_out = _reflect_remainder;
if (POLY_32BIT_REV_ANSI != polynomial) {
crc_mbed_config_t config;
config.polynomial = polynomial;
config.width = width;
config.initial_xor = _initial_value;
config.final_xor = _final_xor;
config.reflect_in = _reflect_data;
config.reflect_out = _reflect_remainder;
if (hal_crc_is_supported(&config)) {
_mode = HARDWARE;
return;
if (hal_crc_is_supported(&config)) {
_mode = HARDWARE;
return;
}
}
#endif