Skip to content

Commit 897aaf1

Browse files
etienne-lmsjforissier
authored andcommitted
ta: pkcs11: fix build warning on unused arguments
Add missing __maybe_unused attribute for function arguments not used when the pkcs11 TA is built with NDEBUG directive, as shown by the following build trace message: ta/pkcs11/src/pkcs11_attributes.c: In function ‘get_default_value’: ta/pkcs11/src/pkcs11_attributes.c:261:61: warning: unused parameter ‘id’ [-Wunused-parameter] 261 | static enum pkcs11_rc get_default_value(enum pkcs11_attr_id id, void **value, | ~~~~~~~~~~~~~~~~~~~~^~ ta/pkcs11/src/pkcs11_attributes.c: In function ‘check_created_attrs_against_processing’: ta/pkcs11/src/pkcs11_attributes.c:1647:73: warning: unused parameter ‘head’ [-Wunused-parameter] 1647 | struct obj_attrs *head) | ~~~~~~~~~~~~~~~~~~^~~~ Fixes: 63f89ca ("ta: pkcs11: attribute helper functions") Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
1 parent d99b271 commit 897aaf1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ta/pkcs11/src/pkcs11_attributes.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ static enum pkcs11_rc set_mandatory_attributes(struct obj_attrs **out,
258258
return rc;
259259
}
260260

261-
static enum pkcs11_rc get_default_value(enum pkcs11_attr_id id, void **value,
262-
uint32_t *size)
261+
static enum pkcs11_rc get_default_value(enum pkcs11_attr_id id __maybe_unused,
262+
void **value, uint32_t *size)
263263
{
264264
/* should have been taken care of already */
265265
assert(!pkcs11_attr_is_boolean(id));
@@ -1643,8 +1643,9 @@ static bool __maybe_unused check_attr_bval(uint32_t proc_id __maybe_unused,
16431643
* @proc_id - PKCS11_CKM_xxx
16441644
* @head - head of the attributes of the to-be-created object.
16451645
*/
1646-
enum pkcs11_rc check_created_attrs_against_processing(uint32_t proc_id,
1647-
struct obj_attrs *head)
1646+
enum pkcs11_rc
1647+
check_created_attrs_against_processing(uint32_t proc_id,
1648+
struct obj_attrs *head __maybe_unused)
16481649
{
16491650
/*
16501651
* Processings that do not create secrets are not expected to call

0 commit comments

Comments
 (0)