]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virnetdevvportprofile: Drop explicit enum virNetDevVPortProfile declaration
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 23 Jul 2025 10:57:18 +0000 (12:57 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 1 Aug 2025 10:24:20 +0000 (12:24 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/netdev_vport_profile_conf.c
src/util/virnetdevvportprofile.c
src/util/virnetdevvportprofile.h

index 523d9b642cfa825b2d2256193f217c127430406e..f7928a5679b4d28f719484c857abc300040fd1f1 100644 (file)
@@ -169,7 +169,7 @@ void
 virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
                             virBuffer *buf)
 {
-    enum virNetDevVPortProfile type;
+    virNetDevVPortProfileType type;
     bool noParameters;
 
     if (!virtPort)
index c755fa79ec02e0e77b06bf6a3b6f42e24421e7dc..221e0888b31bb54a2aa9d47b46245d403354fc09 100644 (file)
@@ -279,7 +279,7 @@ static int
 virNetDevVPortProfileMerge(virNetDevVPortProfile *orig,
                            const virNetDevVPortProfile *mods)
 {
-    enum virNetDevVPortProfile otype;
+    virNetDevVPortProfileType otype;
 
     if (!orig || !mods)
         return 0;
index 600b2093c507e273f30887bee6955eed623b5c3a..43ccb891e75195547bbfe95febabeb74ef8942ac 100644 (file)
@@ -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,