[v2,1/2] drivers/common: fix void function returning a value

Message ID 1737559244-9107-2-git-send-email-andremue@linux.microsoft.com (mailing list archive)
State Accepted
Delegated to: Bruce Richardson
Headers
Series fix void function returning a value |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andre Muezerie Jan. 22, 2025, 3:20 p.m. UTC
This patch avoids warnings like the one below emitted by MSVC:

../drivers/common/idpf/idpf_common_rxtx_avx512.c(139):
    warning C4098: 'idpf_singleq_rearm':
    'void' function returning a value

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 drivers/common/idpf/idpf_common_rxtx_avx512.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
  

Comments

Bruce Richardson Jan. 22, 2025, 3:47 p.m. UTC | #1
On Wed, Jan 22, 2025 at 07:20:43AM -0800, Andre Muezerie wrote:
> This patch avoids warnings like the one below emitted by MSVC:
> 
> ../drivers/common/idpf/idpf_common_rxtx_avx512.c(139):
>     warning C4098: 'idpf_singleq_rearm':
>     'void' function returning a value
> 
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---
>  drivers/common/idpf/idpf_common_rxtx_avx512.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson Feb. 10, 2025, 11:35 a.m. UTC | #2
On Wed, Jan 22, 2025 at 03:47:29PM +0000, Bruce Richardson wrote:
> On Wed, Jan 22, 2025 at 07:20:43AM -0800, Andre Muezerie wrote:
> > This patch avoids warnings like the one below emitted by MSVC:
> > 
> > ../drivers/common/idpf/idpf_common_rxtx_avx512.c(139):
> >     warning C4098: 'idpf_singleq_rearm':
> >     'void' function returning a value
> > 
> > Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> > ---
> >  drivers/common/idpf/idpf_common_rxtx_avx512.c | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Fixes: 5bf87b45b2c8 ("net/idpf: add AVX512 data path for single queue model")
Fixes: e528d7c74819 ("common/idpf: add AVX512 data path for split queue model")
Cc: stable@dpdk.org

patch applied to dpdk-next-net-intel

Thanks,
/Bruce
  

Patch

diff --git a/drivers/common/idpf/idpf_common_rxtx_avx512.c b/drivers/common/idpf/idpf_common_rxtx_avx512.c
index b8450b03ae..9ea71c3718 100644
--- a/drivers/common/idpf/idpf_common_rxtx_avx512.c
+++ b/drivers/common/idpf/idpf_common_rxtx_avx512.c
@@ -137,8 +137,10 @@  idpf_singleq_rearm(struct idpf_rx_queue *rxq)
 
 	rxdp += rxq->rxrearm_start;
 
-	if (unlikely(cache == NULL))
-		return idpf_singleq_rearm_common(rxq);
+	if (unlikely(cache == NULL)) {
+		idpf_singleq_rearm_common(rxq);
+		return;
+	}
 
 	/* We need to pull 'n' more MBUFs into the software ring from mempool
 	 * We inline the mempool function here, so we can vectorize the copy
@@ -607,8 +609,10 @@  idpf_splitq_rearm(struct idpf_rx_queue *rx_bufq)
 
 	rxdp += rx_bufq->rxrearm_start;
 
-	if (unlikely(!cache))
-		return idpf_splitq_rearm_common(rx_bufq);
+	if (unlikely(!cache)) {
+		idpf_splitq_rearm_common(rx_bufq);
+		return;
+	}
 
 	/* We need to pull 'n' more MBUFs into the software ring from mempool
 	 * We inline the mempool function here, so we can vectorize the copy