diff --git a/src/link/endpoint.c b/src/link/endpoint.c index ff596a07b..035e646a6 100644 --- a/src/link/endpoint.c +++ b/src/link/endpoint.c @@ -360,10 +360,7 @@ size_t _z_endpoint_config_strlen(const _z_str_intmap_t *s, const char *proto) { #endif if (_z_str_eq(proto, RAWETH_SCHEMA) == true) { len = _z_raweth_config_strlen(s); - } else { - __asm__("nop"); } - return len; } @@ -398,10 +395,7 @@ char *_z_endpoint_config_to_str(const _z_str_intmap_t *s, const char *proto) { #endif if (_z_str_eq(proto, RAWETH_SCHEMA) == true) { _z_raweth_config_to_str(s); - } else { - __asm__("nop"); } - return res; } diff --git a/src/system/arduino/esp32/network.cpp b/src/system/arduino/esp32/network.cpp index c088f1ce1..c9e521bbd 100644 --- a/src/system/arduino/esp32/network.cpp +++ b/src/system/arduino/esp32/network.cpp @@ -557,9 +557,7 @@ int8_t _z_open_bt(_z_sys_net_socket_t *sock, const char *gname, uint8_t mode, ui sock->_bts->begin(gname, true); uint8_t connected = sock->_bts->connect(gname); if (!connected) { - while (!sock->_bts->connected(tout)) { - __asm__("nop"); - } + while (!sock->_bts->connected(tout)); } } else { delete sock->_bts; @@ -583,9 +581,7 @@ int8_t _z_listen_bt(_z_sys_net_socket_t *sock, const char *gname, uint8_t mode, sock->_bts->begin(gname, true); uint8_t connected = sock->_bts->connect(gname); if (!connected) { - while (!sock->_bts->connected(tout)) { - __asm__("nop"); - } + while (!sock->_bts->connected(tout)); } } else { delete sock->_bts; diff --git a/src/system/unix/system.c b/src/system/unix/system.c index 28223b83f..bf3ac4455 100644 --- a/src/system/unix/system.c +++ b/src/system/unix/system.c @@ -31,9 +31,8 @@ uint8_t z_random_u8(void) { uint8_t ret = 0; #if defined(ZENOH_LINUX) - while (getrandom(&ret, sizeof(uint8_t), 0) <= 0) { - __asm__("nop"); - } + while (getrandom(&ret, sizeof(uint8_t), 0) <= 0) + ; #elif defined(ZENOH_MACOS) || defined(ZENOH_BSD) ret = z_random_u32(); #endif @@ -44,9 +43,8 @@ uint8_t z_random_u8(void) { uint16_t z_random_u16(void) { uint16_t ret = 0; #if defined(ZENOH_LINUX) - while (getrandom(&ret, sizeof(uint16_t), 0) <= 0) { - __asm__("nop"); - } + while (getrandom(&ret, sizeof(uint16_t), 0) <= 0) + ; #elif defined(ZENOH_MACOS) || defined(ZENOH_BSD) ret = z_random_u32(); #endif @@ -57,9 +55,8 @@ uint16_t z_random_u16(void) { uint32_t z_random_u32(void) { uint32_t ret = 0; #if defined(ZENOH_LINUX) - while (getrandom(&ret, sizeof(uint32_t), 0) <= 0) { - __asm__("nop"); - } + while (getrandom(&ret, sizeof(uint32_t), 0) <= 0) + ; #elif defined(ZENOH_MACOS) || defined(ZENOH_BSD) ret = arc4random(); #endif @@ -70,9 +67,8 @@ uint32_t z_random_u32(void) { uint64_t z_random_u64(void) { uint64_t ret = 0; #if defined(ZENOH_LINUX) - while (getrandom(&ret, sizeof(uint64_t), 0) <= 0) { - __asm__("nop"); - } + while (getrandom(&ret, sizeof(uint64_t), 0) <= 0) + ; #elif defined(ZENOH_MACOS) || defined(ZENOH_BSD) ret |= z_random_u32(); ret = ret << 32; @@ -84,9 +80,8 @@ uint64_t z_random_u64(void) { void z_random_fill(void *buf, size_t len) { #if defined(ZENOH_LINUX) - while (getrandom(buf, len, 0) <= 0) { - __asm__("nop"); - } + while (getrandom(buf, len, 0) <= 0) + ; #elif defined(ZENOH_MACOS) || defined(ZENOH_BSD) arc4random_buf(buf, len); #endif