mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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)
This commit is contained in:
parent
4b521ea870
commit
646d5b96b4
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue