Skip to content

Commit 21ed998

Browse files
committed
DPDK: Remove duplicate code
This change better shows that the type and name of the static structure are identical in #if and #else.
1 parent 45cefdf commit 21ed998

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pcap-dpdk.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,20 @@ struct pcap_dpdk{
196196
unsigned char pcap_tmp_buf[RTE_ETH_PCAP_SNAPLEN];
197197
};
198198

199-
#if (RTE_VERSION < RTE_VERSION_NUM(22, 0, 0, 0))
200199
static struct rte_eth_conf port_conf = {
200+
#if (RTE_VERSION < RTE_VERSION_NUM(22, 0, 0, 0))
201201
.rxmode = {
202202
.split_hdr_size = 0,
203203
},
204204
.txmode = {
205205
.mq_mode = ETH_MQ_TX_NONE,
206206
},
207-
};
208207
#else
209-
static struct rte_eth_conf port_conf = {
210208
.txmode = {
211209
.mq_mode = RTE_ETH_MQ_TX_NONE,
212210
},
213-
};
214211
#endif
212+
};
215213

216214
static void dpdk_fmt_errmsg_for_rte_errno(char *, size_t, int,
217215
PCAP_FORMAT_STRING(const char *), ...) PCAP_PRINTFLIKE(4, 5);

0 commit comments

Comments
 (0)