From: Michal Privoznik Date: Wed, 23 Jul 2025 10:57:18 +0000 (+0200) Subject: virnetdevvportprofile: Drop explicit enum virNetDevVPortProfile declaration X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=425ffa3cd52cc44199a5c5f6d77878e4488ee76d;p=thirdparty%2Flibvirt.git virnetdevvportprofile: Drop explicit enum virNetDevVPortProfile declaration The virNetDevVPortProfile enum is both explicitly declared and also typedef-ed. This repetition is redundant. Just use typedef. To make matters worse, there's another type with the same name, but because in the code, those few places used 'enum virNetDevVPortProfile var;' to declare variables compilers didn't complain. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c index 523d9b642c..f7928a5679 100644 --- a/src/conf/netdev_vport_profile_conf.c +++ b/src/conf/netdev_vport_profile_conf.c @@ -169,7 +169,7 @@ void virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort, virBuffer *buf) { - enum virNetDevVPortProfile type; + virNetDevVPortProfileType type; bool noParameters; if (!virtPort) diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c index c755fa79ec..221e0888b3 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -279,7 +279,7 @@ static int virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, const virNetDevVPortProfile *mods) { - enum virNetDevVPortProfile otype; + virNetDevVPortProfileType otype; if (!orig || !mods) return 0; diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h index 600b2093c5..43ccb891e7 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -25,7 +25,7 @@ #define LIBVIRT_IFLA_VF_PORT_PROFILE_MAX 40 -typedef enum virNetDevVPortProfile { +typedef enum { VIR_NETDEV_VPORT_PROFILE_NONE, VIR_NETDEV_VPORT_PROFILE_8021QBG, VIR_NETDEV_VPORT_PROFILE_8021QBH,