[12/15] net/ena: fix invalid return value check

Message ID 20240702144626.14545-13-shaibran@amazon.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/ena: driver release 2.10.0 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Brandes, Shai July 2, 2024, 2:46 p.m. UTC
From: Shai Brandes <shaibran@amazon.com>

Removed the sign inversion for when checking if
ena_com_set_host_attributes returns ENA_COM_UNSUPPORTED.
ENA_COM_UNSUPPORTED is defined as -EOPNOTSUPP, so the extra sign
inversion is wrong.

Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org

Signed-off-by: Shai Brandes <shaibran@amazon.com>
---
 doc/guides/rel_notes/release_24_07.rst | 1 +
 drivers/net/ena/ena_ethdev.c           | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit July 7, 2024, 6:57 p.m. UTC | #1
On 7/2/2024 3:46 PM, shaibran@amazon.com wrote:
> From: Shai Brandes <shaibran@amazon.com>
> 
> Removed the sign inversion for when checking if
> ena_com_set_host_attributes returns ENA_COM_UNSUPPORTED.
> ENA_COM_UNSUPPORTED is defined as -EOPNOTSUPP, so the extra sign
> inversion is wrong.
> 
> Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shai Brandes <shaibran@amazon.com>
> ---
>  doc/guides/rel_notes/release_24_07.rst | 1 +
>  drivers/net/ena/ena_ethdev.c           | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
> index f000dec54b..24bb91ad46 100644
> --- a/doc/guides/rel_notes/release_24_07.rst
> +++ b/doc/guides/rel_notes/release_24_07.rst
> @@ -79,6 +79,7 @@ New Features
>    * Reworked the device uninitialization flow to ensure complete resource
>      cleanup and lay the groundwork for hot-unplug support.
>    * Removed an obsolete workaround for a false L4 bad Rx checksum indication.
> +  * Fixed an invalid return value check.
>

Dropped this release notes update while merging, as it looks not
significant enough for the release notes.
  

Patch

diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
index f000dec54b..24bb91ad46 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -79,6 +79,7 @@  New Features
   * Reworked the device uninitialization flow to ensure complete resource
     cleanup and lay the groundwork for hot-unplug support.
   * Removed an obsolete workaround for a false L4 bad Rx checksum indication.
+  * Fixed an invalid return value check.
 
 * **Update Tap PMD driver.**
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index b43b913903..67a1d86f9a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -812,7 +812,7 @@  static void ena_config_host_info(struct ena_com_dev *ena_dev)
 
 	rc = ena_com_set_host_attributes(ena_dev);
 	if (rc) {
-		if (rc == -ENA_COM_UNSUPPORTED)
+		if (rc == ENA_COM_UNSUPPORTED)
 			PMD_DRV_LOG(WARNING, "Cannot set host attributes\n");
 		else
 			PMD_DRV_LOG(ERR, "Cannot set host attributes\n");
@@ -856,7 +856,7 @@  static void ena_config_debug_area(struct ena_adapter *adapter)
 
 	rc = ena_com_set_host_attributes(&adapter->ena_dev);
 	if (rc) {
-		if (rc == -ENA_COM_UNSUPPORTED)
+		if (rc == ENA_COM_UNSUPPORTED)
 			PMD_DRV_LOG(WARNING, "Cannot set host attributes\n");
 		else
 			PMD_DRV_LOG(ERR, "Cannot set host attributes\n");