Move the code that implements VF version compatibility on the PF side to
a separate function so that it can be reused when doing VM live
migration.
This does not introduce any functional change.
Signed-off-by: Xin Zeng <xin.zeng@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
                        "VersionRequest received from VF%d (vers %d) to PF (vers %d)\n",
                        vf_nr, vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION);
 
-               if (vf_compat_ver == 0)
-                       compat = ADF_PF2VF_VF_INCOMPATIBLE;
-               else if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION)
-                       compat = ADF_PF2VF_VF_COMPATIBLE;
-               else
-                       compat = ADF_PF2VF_VF_COMPAT_UNKNOWN;
-
+               compat = adf_vf_compat_checker(vf_compat_ver);
                vf_info->vf_compat_ver = vf_compat_ver;
 
                resp->type = ADF_PF2VF_MSGTYPE_VERSION_RESP;
 
 struct pfvf_message adf_pfvf_message_of(struct adf_accel_dev *accel_dev, u32 raw_msg,
                                        const struct pfvf_csr_format *fmt);
 
+static inline u8 adf_vf_compat_checker(u8 vf_compat_ver)
+{
+       if (vf_compat_ver == 0)
+               return ADF_PF2VF_VF_INCOMPATIBLE;
+
+       if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION)
+               return ADF_PF2VF_VF_COMPATIBLE;
+
+       return ADF_PF2VF_VF_COMPAT_UNKNOWN;
+}
+
 #endif /* ADF_PFVF_UTILS_H */