1From 090854e09fe18ebf1ba428864895a690086f78ee Mon Sep 17 00:00:00 2001 2From: Aaron Conole <aconole@redhat.com> 3Date: Mon, 19 Aug 2019 11:41:13 -0400 4Subject: [PATCH 1/9] cmds: fix enum conversion 5 6Multiple modules use implicit conversion between enum types, but 7this triggers warnings with some compilers. ex: 8 9 qbg/vdp_cmds.c:110:39: error: implicit conversion from enumeration type 10 'lldp_cmd' to different enumeration type 'cmd_status' 11 [-Werror,-Wenum-conversion] 12 cmd_status good_cmd = vdp_cmdok(cmd, cmd_gettlv); 13 14Reported-at: https://github.com/intel/openlldp/issues/53 15Signed-off-by: Aaron Conole <aconole@redhat.com> 16--- 17 lldp_evb22_cmds.c | 2 +- 18 lldp_evb_cmds.c | 2 +- 19 qbg/vdp22_cmds.c | 2 +- 20 qbg/vdp_cmds.c | 2 +- 21 vdptool.c | 2 +- 22 5 files changed, 5 insertions(+), 5 deletions(-) 23 24diff --git a/lldp_evb22_cmds.c b/lldp_evb22_cmds.c 25index cebfeb2..51810bc 100644 26--- a/lldp_evb22_cmds.c 27+++ b/lldp_evb22_cmds.c 28@@ -225,7 +225,7 @@ int evb22_conf_enabletx(char *ifname, enum agent_type type) 29 TLVID(OUI_IEEE_8021Qbg22, LLDP_EVB22_SUBTYPE)); 30 } 31 32-static int evb22_cmdok(struct cmd *cmd, cmd_status expected) 33+static int evb22_cmdok(struct cmd *cmd, int expected) 34 { 35 if (cmd->cmd != expected) 36 return cmd_invalid; 37diff --git a/lldp_evb_cmds.c b/lldp_evb_cmds.c 38index eec4f33..e6af03b 100644 39--- a/lldp_evb_cmds.c 40+++ b/lldp_evb_cmds.c 41@@ -163,7 +163,7 @@ int evb_conf_enabletx(char *ifname, enum agent_type type) 42 return is_tlv_txenabled(ifname, type, TLVID_8021Qbg(LLDP_EVB_SUBTYPE)); 43 } 44 45-static int evb_cmdok(struct cmd *cmd, cmd_status expected) 46+static int evb_cmdok(struct cmd *cmd, int expected) 47 { 48 if (cmd->cmd != expected) 49 return cmd_invalid; 50diff --git a/qbg/vdp22_cmds.c b/qbg/vdp22_cmds.c 51index 479b1b0..2e1bbbd 100644 52--- a/qbg/vdp22_cmds.c 53+++ b/qbg/vdp22_cmds.c 54@@ -296,7 +296,7 @@ int vdp22_sendevent(struct vdpnl_vsi *p) 55 return 0; 56 } 57 58-static int vdp22_cmdok(struct cmd *cmd, cmd_status expected) 59+static int vdp22_cmdok(struct cmd *cmd, int expected) 60 { 61 if (cmd->cmd != expected) 62 return cmd_invalid; 63diff --git a/qbg/vdp_cmds.c b/qbg/vdp_cmds.c 64index 95bcfb1..50f2781 100644 65--- a/qbg/vdp_cmds.c 66+++ b/qbg/vdp_cmds.c 67@@ -85,7 +85,7 @@ static char *print_mode(char *s, size_t length, struct vsi_profile *p) 68 return s; 69 } 70 71-static int vdp_cmdok(struct cmd *cmd, cmd_status expected) 72+static int vdp_cmdok(struct cmd *cmd, int expected) 73 { 74 if (cmd->cmd != expected) 75 return cmd_invalid; 76diff --git a/vdptool.c b/vdptool.c 77index 9872348..8f36277 100644 78--- a/vdptool.c 79+++ b/vdptool.c 80@@ -141,7 +141,7 @@ static char *print_status(cmd_status status) 81 str = "TLV does not support agent type"; 82 break; 83 default: 84- str = print_vdp_status(status); 85+ str = print_vdp_status((enum vdp22_cmd_status)status); 86 break; 87 } 88 return str; 89-- 902.28.0 91 92