[v2] net/sfc: fix build when assert enabled

Message ID 20211013163219.1933273-1-andrew.rybchenko@oktetlabs.ru (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] net/sfc: fix build when assert enabled |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing warning apply patch failure
ci/Intel-compilation warning apply issues

Commit Message

Andrew Rybchenko Oct. 13, 2021, 4:32 p.m. UTC
  When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
build fails:
../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
../drivers/net/sfc/sfc_repr.c:251:20:
    warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
    did you mean ‘rte_spinlock_is_locked’?
    [-Wimplicit-function-declaration]
  251 |         SFC_ASSERT(sfc_repr_lock_is_locked(sr));
      |                    ^~~~~~~~~~~~~~~~~~~~~~~

Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")

Reported-by: Raslan Darawsheh <rasland@nvidia.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_repr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Oct. 13, 2021, 5:16 p.m. UTC | #1
On 10/13/2021 5:32 PM, Andrew Rybchenko wrote:
> When 'RTE_ENABLE_ASSERT' is enabled (meson -Dc_args=-DRTE_ENABLE_ASSERT)
> build fails:
> ../drivers/net/sfc/sfc_repr.c: In function ‘sfc_repr_start’:
> ../drivers/net/sfc/sfc_repr.c:251:20:
>      warning: implicit declaration of function ‘sfc_repr_lock_is_locked’;
>      did you mean ‘rte_spinlock_is_locked’?
>      [-Wimplicit-function-declaration]
>    251 |         SFC_ASSERT(sfc_repr_lock_is_locked(sr));
>        |                    ^~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixes: c85675423f01 ("net/sfc: implement port representor start and stop")
> 
> Reported-by: Raslan Darawsheh <rasland@nvidia.com>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Squashed into relevant commit [1] in next-net, thanks.

[1]
net/sfc: add port representors infrastructure
  

Patch

diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 6ec83873ab..2500b14cb0 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -116,7 +116,7 @@  sfc_repr_lock_init(struct sfc_repr *sr)
 	rte_spinlock_init(&sr->lock);
 }
 
-#ifdef RTE_LIBRTE_SFC_EFX_DEBUG
+#if defined(RTE_LIBRTE_SFC_EFX_DEBUG) || defined(RTE_ENABLE_ASSERT)
 
 static inline int
 sfc_repr_lock_is_locked(struct sfc_repr *sr)