[v1] gpu/cuda: set unused gdrcopy functions arguments
Checks
Commit Message
From: Elena Agostini <eagostini@nvidia.com>
Without enabling gdrcopy, dpdk build has warnings about
unused gdrcopy functions input parameters.
This patch set them to __rte_unused .
Fixes: 24c7759 ("gpu/cuda: map GPU memory with GDRCopy")
Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
drivers/gpu/cuda/gdrcopy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
10/03/2022 01:06, eagostini@nvidia.com:
> From: Elena Agostini <eagostini@nvidia.com>
>
> Without enabling gdrcopy, dpdk build has warnings about
> unused gdrcopy functions input parameters.
As developers we should test with --werror option given to meson,
so we don't miss such details.
This is what the script devtools/test-meson-builds.sh does.
> This patch set them to __rte_unused .
>
> Fixes: 24c7759 ("gpu/cuda: map GPU memory with GDRCopy")
Let's keep this casing of GDRCopy in the new title.
> Signed-off-by: Elena Agostini <eagostini@nvidia.com>
> ---
> int
> -gdrcopy_pin(gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, uint64_t d_addr, size_t size, void **h_addr)
> +gdrcopy_pin(__rte_unused gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, __rte_unused uint64_t d_addr, __rte_unused size_t size, __rte_unused void **h_addr)
While at it, break the too long line.
It seems my compiler is smart enough to not require the unused attribute
for parameters used in another branch of #ifdef.
But it is probably required for some old compilers.
Applied, thanks.
@@ -80,7 +80,7 @@ gdrcopy_open(gdr_t *g)
#endif
int
-gdrcopy_pin(gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, uint64_t d_addr, size_t size, void **h_addr)
+gdrcopy_pin(__rte_unused gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, __rte_unused uint64_t d_addr, __rte_unused size_t size, __rte_unused void **h_addr)
{
#ifdef DRIVERS_GPU_CUDA_GDRCOPY_H
if (*gdrc_h == NULL) {
@@ -116,7 +116,7 @@ gdrcopy_pin(gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, uint64_t d_addr, size_t si
}
int
-gdrcopy_unpin(gdr_t gdrc_h, __rte_unused gdr_mh_t mh, void *d_addr, size_t size)
+gdrcopy_unpin(gdr_t gdrc_h, __rte_unused gdr_mh_t mh, __rte_unused void *d_addr, __rte_unused size_t size)
{
if (gdrc_h == NULL)
return -EINVAL;