Skip to contentSkip to conversation

eventdev: fix build with clang 21

PATCH Applied David Marchand 2 participants 3 messages Nov 4, 2025 – Nov 5, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eventdev: fix build with clang 21

Fix 16-bits formatting issues reported by clang 21 on Fedora 43:

../lib/eventdev/rte_event_crypto_adapter.c:1461:4: error:

	format specifies type 'unsigned char' but the argument has type
	'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]
 1459 |     RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1460 |             " cdev %" PRIu8, adapter->eventdev_id,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1461 |             adapter->next_cdev_id);
      |             ^~~~~~~~~~~~~~~~~~~~~~

../lib/eventdev/rte_event_crypto_adapter.c:1592:46: error:

	format specifies type 'unsigned char' but the argument has type
	'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]
 1592 |     RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

../lib/eventdev/rte_event_crypto_adapter.c:1613:45: error:

	format specifies type 'unsigned char' but the argument has type
	'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]
 1612 |     RTE_EDEV_LOG_ERR("Event vectorization is not supported,"
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1613 |                      "dev %" PRIu8 " cdev %" PRIu8, dev_id, cdev_id);
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Fixes c1749bc5ee10 ("eventdev: introduce event cryptodev vector type")
Fixes 04ed18cd41f1 ("eventdev/crypto: support runtime set/get parameters")
---
 lib/eventdev/rte_event_crypto_adapter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/eventdev/rte_event_crypto_adapter.c +3 -3
index b827a0ffd6..3f9cc7379a 100644
@@ -1457,7 +1457,7 @@ crypto_adapter_cap_check(struct event_crypto_adapter *adapter)
 						&caps);
 	if (ret) {
 		RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8
-			" cdev %" PRIu8, adapter->eventdev_id,
+			" cdev %" PRIu16, adapter->eventdev_id,
 			adapter->next_cdev_id);
 		return ret;
 	}
@@ -1589,7 +1589,7 @@ rte_event_crypto_adapter_vector_limits_get(
 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
 
 	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
-		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu16, cdev_id);
 		return -EINVAL;
 	}
 
@@ -1610,7 +1610,7 @@ rte_event_crypto_adapter_vector_limits_get(
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR)) {
 		RTE_EDEV_LOG_ERR("Event vectorization is not supported,"
-				 "dev %" PRIu8 " cdev %" PRIu8, dev_id, cdev_id);
+				 "dev %" PRIu8 " cdev %" PRIu16, dev_id, cdev_id);
 		return -ENOTSUP;
 	}
 
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 38 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Tuesday, November 4, 2025 6:38 PM
To: [email protected]
Cc: [email protected]; Gujjar, Abhinandan S <[email protected]>; Jerin Jacob <[email protected]>; Akhil Goyal <[email protected]>; Volodymyr Fialko <[email protected]>; Naga Harish K, S V <[email protected]>
Subject: [PATCH] eventdev: fix build with clang 21

Fix 16-bits formatting issues reported by clang 21 on Fedora 43:

../lib/eventdev/rte_event_crypto_adapter.c:1461:4: error:

	format specifies type 'unsigned char' but the argument has type
	'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]
 1459 |     RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1460 |             " cdev %" PRIu8, adapter->eventdev_id,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1461 |             adapter->next_cdev_id);
      |             ^~~~~~~~~~~~~~~~~~~~~~

../lib/eventdev/rte_event_crypto_adapter.c:1592:46: error:

	format specifies type 'unsigned char' but the argument has type
	'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]
 1592 |     RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

../lib/eventdev/rte_event_crypto_adapter.c:1613:45: error:

	format specifies type 'unsigned char' but the argument has type
	'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]
 1612 |     RTE_EDEV_LOG_ERR("Event vectorization is not supported,"
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1613 |                      "dev %" PRIu8 " cdev %" PRIu8, dev_id, cdev_id);
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Quoted 5 lines
Fixes c1749bc5ee10 ("eventdev: introduce event cryptodev vector type")
Fixes 04ed18cd41f1 ("eventdev/crypto: support runtime set/get parameters")
Quoted 41 lines
---
 lib/eventdev/rte_event_crypto_adapter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/eventdev/rte_event_crypto_adapter.c +1 -1
index b827a0ffd6..3f9cc7379a 100644
@@ -1457,7 +1457,7 @@ crypto_adapter_cap_check(struct
 event_crypto_adapter *adapter)
 						&caps);
 	if (ret) {
 		RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8
-			" cdev %" PRIu8, adapter->eventdev_id,
+			" cdev %" PRIu16, adapter->eventdev_id,
 			adapter->next_cdev_id);
 		return ret;
lib/eventdev/rte_event_crypto_adapter.c +2 -2
 	}
@@ -1589,7 +1589,7 @@ rte_event_crypto_adapter_vector_limits_get(
 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
 
 	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
-		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu16, cdev_id);
 		return -EINVAL;
 	}
 
@@ -1610,7 +1610,7 @@ rte_event_crypto_adapter_vector_limits_get(
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR)) {
 		RTE_EDEV_LOG_ERR("Event vectorization is not supported,"
-				 "dev %" PRIu8 " cdev %" PRIu8, dev_id,
 cdev_id);
+				 "dev %" PRIu8 " cdev %" PRIu16, dev_id,
 cdev_id);
 		return -ENOTSUP;

}

--
2.51.0

author Applied
#2 lore raw
In reply to David Marchand
Quoted 27 lines · David Marchand

Fix 16-bits formatting issues reported by clang 21 on Fedora 43:

../lib/eventdev/rte_event_crypto_adapter.c:1461:4: error:
format specifies type 'unsigned char' but the argument has type 'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]

 1459 |     RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1460 |             " cdev %" PRIu8, adapter->eventdev_id,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1461 |             adapter->next_cdev_id);
      |             ^~~~~~~~~~~~~~~~~~~~~~

../lib/eventdev/rte_event_crypto_adapter.c:1592:46: error:
format specifies type 'unsigned char' but the argument has type 'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]

 1592 |     RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

../lib/eventdev/rte_event_crypto_adapter.c:1613:45: error:
format specifies type 'unsigned char' but the argument has type 'uint16_t' (aka 'unsigned short') [-Werror,-Wformat]

 1612 |     RTE_EDEV_LOG_ERR("Event vectorization is not supported,"
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1613 |                      "dev %" PRIu8 " cdev %" PRIu8, dev_id, cdev_id);
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Quoted 5 lines
Fixes c1749bc5ee10 ("eventdev: introduce event cryptodev vector type")
Fixes 04ed18cd41f1 ("eventdev/crypto: support runtime set/get parameters")

Applied, thanks.

Signature · 1 line
David Marchand