raw/skeleton: remove useless check

Message ID 20221004080026.180919-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series raw/skeleton: remove useless check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

David Marchand Oct. 4, 2022, 8 a.m. UTC
  As reported by Coverity, this check is pointless since dev is already
dereferenced earlier. Besides, dev is passed by the rawdev layer and
can't be NULL.

Note: the issue was probably present before the incriminated commit.
It is unclear why Coverity would start complaining about this now.

Coverity issue: 380991
Fixes: 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Hemant Agrawal Oct. 4, 2022, 12:19 p.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  
David Marchand Oct. 5, 2022, 7:36 p.m. UTC | #2
On Tue, Oct 4, 2022 at 10:00 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> As reported by Coverity, this check is pointless since dev is already
> dereferenced earlier. Besides, dev is passed by the rawdev layer and
> can't be NULL.
>
> Note: the issue was probably present before the incriminated commit.
> It is unclear why Coverity would start complaining about this now.
>
> Coverity issue: 380991
> Fixes: 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Applied, thanks.
  

Patch

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 1d043bec5d..b2ca1cc5cd 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -475,9 +475,6 @@  static int skeleton_rawdev_firmware_status_get(struct rte_rawdev *dev,
 
 	skeldev = skeleton_rawdev_get_priv(dev);
 
-	if (dev == NULL)
-		return -EINVAL;
-
 	if (status_info)
 		memcpy(status_info, &skeldev->fw.firmware_state,
 			sizeof(enum skeleton_firmware_state));