Skip to content

Commit 5674797

Browse files
authored
Merge pull request #11392 from hugueskamba/hk-remove-minor-warnings
Remove minor build warnings
2 parents d135e9b + 9f44c2c commit 5674797

File tree

12 files changed

+20
-21
lines changed

12 files changed

+20
-21
lines changed

components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl/attestation_core.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,6 @@ attest_create_token(struct useful_buf_c *challenge,
841841
enum attest_token_err_t token_err;
842842
struct attest_token_ctx attest_token_ctx;
843843
int32_t key_select;
844-
int32_t alg_select;
845844
uint32_t option_flags = 0;
846845

847846
if (challenge->len == 36) {
@@ -855,14 +854,6 @@ attest_create_token(struct useful_buf_c *challenge,
855854
/* Lower three bits are the key select */
856855
key_select = option_flags & 0x7;
857856

858-
/* Map the key select to an algorithm. Maybe someday we'll support something
859-
* other than ES256
860-
*/
861-
switch (key_select) {
862-
default:
863-
alg_select = COSE_ALGORITHM_ES256;
864-
}
865-
866857
/* Get started creating the token. This sets up the CBOR and COSE contexts
867858
* which causes the COSE headers to be constructed.
868859
*/

drivers/source/usb/USBDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ bool USBDevice::_request_setup()
616616
bool success = false;
617617

618618
/* Process standard requests */
619-
if ((_transfer.setup.bmRequestType.Type == STANDARD_TYPE)) {
619+
if (_transfer.setup.bmRequestType.Type == STANDARD_TYPE) {
620620
switch (_transfer.setup.bRequest) {
621621
case GET_STATUS:
622622
success = _request_get_status();

features/cellular/framework/AT/ATHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ void ATHandler::write_int(int32_t param)
13941394
// write the integer subparameter
13951395
const int32_t str_len = 12;
13961396
char number_string[str_len];
1397-
int32_t result = sprintf(number_string, "%ld", param);
1397+
int32_t result = sprintf(number_string, "%" PRIi32, param);
13981398
if (result > 0 && result < str_len) {
13991399
(void)write(number_string, strlen(number_string));
14001400
}

features/cellular/framework/AT/AT_CellularBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ intptr_t AT_CellularBase::get_property(CellularProperty key)
5151
if (_property_array) {
5252
return _property_array[key];
5353
} else {
54-
return NULL;
54+
return 0;
5555
}
5656
}

features/cellular/framework/device/CellularContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ CellularContext::CellularContext() : _next(0), _stack(0), _pdp_type(DEFAULT_PDP_
6464
_apn(0), _uname(0), _pwd(0), _dcd_pin(NC), _active_high(false), _cp_netif(0), _retry_array_length(0),
6565
_retry_count(0), _device(0), _nw(0), _is_blocking(true), _nonip_req(false), _cp_in_use(false)
6666
{
67-
memset(_retry_timeout_array, 0, CELLULAR_RETRY_ARRAY_SIZE);
67+
memset(_retry_timeout_array, 0, sizeof(_retry_timeout_array));
6868
}
6969

7070
void CellularContext::cp_data_received()

features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ void QUECTEL_BG96_CellularStack::ip2dot(const SocketAddress &ip, char *dot)
413413
{
414414
if (ip.get_ip_version() == NSAPI_IPv6) {
415415
const uint8_t *bytes = (uint8_t *)ip.get_ip_bytes();
416-
char *p = dot;
417416
for (int i = 0; i < NSAPI_IPv6_BYTES; i += 2) {
418417
if (i != 0) {
419418
*dot++ = ':';

features/frameworks/TARGET_PSA/val_greentea.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ val_status_t mbed_val_execute_non_secure_tests(uint32_t test_num, client_test_t
6767
while (tests_list[i] != NULL)
6868
{
6969
memset(testcase_name, 0, 100);
70-
sprintf(testcase_name, "Check%d", i);
70+
sprintf(testcase_name, "Check%" PRIu32, i);
7171
GREENTEA_TESTCASE_START(testcase_name);
7272
if (server_hs == TRUE)
7373
{

features/frameworks/mbed-coap/source/sn_coap_protocol.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,8 @@ void sn_coap_protocol_linked_list_duplication_info_remove(struct coap_s *handle,
12031203
(void)msg_id;
12041204
#endif //SN_COAP_DUPLICATION_MAX_MSGS_COUNT
12051205
}
1206+
1207+
#if SN_COAP_DUPLICATION_MAX_MSGS_COUNT
12061208
static void sn_coap_protocol_duplication_info_free(struct coap_s *handle, coap_duplication_info_s *duplication_info_ptr)
12071209
{
12081210
if (duplication_info_ptr) {
@@ -1214,6 +1216,7 @@ static void sn_coap_protocol_duplication_info_free(struct coap_s *handle, coap_d
12141216
handle->sn_coap_protocol_free(duplication_info_ptr);
12151217
}
12161218
}
1219+
#endif // SN_COAP_DUPLICATION_MAX_MSGS_COUNT
12171220

12181221
#if SN_COAP_BLOCKWISE_ENABLED || SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE
12191222
/**************************************************************************//**

features/nfc/stack/transceiver/pn512/pn512_poll.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,10 @@ void pn512_initiator_isob_anticollision_reqb(pn512_t *pPN512)
537537
ac_buffer_builder_write_nu8(pDataOutBldr, REQB);
538538
ac_buffer_builder_write_nu8(pDataOutBldr, 0x00); // AFI: All card types should respond
539539
uint8_t wup = 0;
540-
if ((pPN512->anticollision.iso_b.slots_num_exponent == 0)) { //&& (pPN512->anticollision.iso_b.slot_number == 0))
540+
if (
541+
pPN512->anticollision.iso_b.slots_num_exponent == 0
542+
//&& (pPN512->anticollision.iso_b.slot_number == 0)
543+
) {
541544
wup |= 0x8; // Send Wake-Up command on first iteration
542545
}
543546
ac_buffer_builder_write_nu8(pDataOutBldr, wup | (pPN512->anticollision.iso_b.slots_num_exponent & 0x7)); // Param: number of slots

features/nfc/stack/transceiver/pn512/pn512_rf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ nfc_err_t pn512_framing_set(pn512_t *pPN512, nfc_framing_t framing)
107107
return NFC_ERR_UNSUPPORTED;
108108
}
109109
#if 1
110-
if ((pPN512->framing == nfc_framing_initiator_a_106) /*|| (pPN512->framing == pn512_framing_target_iso14443a_106k)*/) {
110+
if (
111+
pPN512->framing == nfc_framing_initiator_a_106
112+
//|| (pPN512->framing == pn512_framing_target_iso14443a_106k)
113+
) {
111114
//Enable 100% ASK Modulation
112115
pn512_register_write(pPN512, PN512_REG_TXAUTO, pn512_register_read(pPN512, PN512_REG_TXAUTO) | 0x40);
113116
} else {

0 commit comments

Comments
 (0)