git: 8356d8ff63a3 - stable/13 - Fix enum warning in iavf
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 04 Aug 2024 10:24:11 UTC
The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8356d8ff63a3ffab8b1ff91c922ca7865de9dfc3 commit 8356d8ff63a3ffab8b1ff91c922ca7865de9dfc3 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-07-31 11:01:20 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-08-04 10:23:02 +0000 Fix enum warning in iavf This fixes a clang 19 warning: sys/dev/iavf/iavf_lib.c:514:39: error: comparison of different enumeration types ('enum virtchnl_vsi_type' and 'enum iavf_vsi_type') [-Werror,-Wenum-compare] 514 | if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ The `vsi_type` field of `struct virtchnl_vsi_resource` is of type `enum virtchnl_vsi_type`, not `enum iavf_vsi_type`. In this case, we can seamlessly replace the value with `VIRTCHNL_VSI_SRIOV`, which is numerically equal to `IAVF_VSI_SRIOV`. MFC after: 3 days (cherry picked from commit 67be1e195acfaec99ce4fffeb17111ce085755f7) --- sys/dev/iavf/iavf_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index 15e9a334c7fe..bac6d0948c32 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -511,7 +511,7 @@ iavf_get_vsi_res_from_vf_res(struct iavf_sc *sc) for (int i = 0; i < sc->vf_res->num_vsis; i++) { /* XXX: We only use the first VSI we find */ - if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV) + if (sc->vf_res->vsi_res[i].vsi_type == VIRTCHNL_VSI_SRIOV) sc->vsi_res = &sc->vf_res->vsi_res[i]; } if (!sc->vsi_res) {