eventdev: fix build with clang 21

Message ID 20251104130820.2692144-1-david.marchand@redhat.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series eventdev: fix build with clang 21 |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/github-robot-post success github post: success
ci/intel-Testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/aws-unit-testing success Unit Testing PASS
ci/iol-unit-arm64-testing success Testing PASS

Commit Message

David Marchand Nov. 4, 2025, 1:08 p.m. UTC
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")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Gujjar, Abhinandan S Nov. 4, 2025, 2:23 p.m. UTC | #1
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, November 4, 2025 6:38 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> Jerin Jacob <jerinj@marvell.com>; Akhil Goyal <gakhil@marvell.com>;
> Volodymyr Fialko <vfialko@marvell.com>; Naga Harish K, S V
> <s.v.naga.harish.k@intel.com>
> 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);
>       |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> 
> Fixes: c1749bc5ee10 ("eventdev: introduce event cryptodev vector type")
> Fixes: 04ed18cd41f1 ("eventdev/crypto: support runtime set/get parameters")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: abhinandan.gujjar@intel.com

> ---
>  lib/eventdev/rte_event_crypto_adapter.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index b827a0ffd6..3f9cc7379a 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -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;
>  	}
> 
> --
> 2.51.0
  
David Marchand Nov. 5, 2025, 7:16 a.m. UTC | #2
On Tue, 4 Nov 2025 at 14:08, David Marchand <david.marchand@redhat.com> wrote:
>
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index b827a0ffd6..3f9cc7379a 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -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;
 	}