Skip to contentSkip to conversation

eal/bsdapp: fix compilation on FreeBSD

PATCH Applied Bruce Richardson 2 participants 2 messages May 5, 2015 – May 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal/bsdapp: fix compilation on FreeBSD

Fixes 6065355a "pci: make device id tables const"

Following the above commit, compilation on FreeBSD with clang was broken, giving the error message:

.../lib/librte_eal/bsdapp/eal/eal_pci.c:438:16: fatal error: assigning to

      'struct rte_pci_id *' from 'const struct rte_pci_id *' discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
        for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
                      ^ ~~~~~~~~~~~~

This patch fixes the issue by adding "const" to the type of id_table.

---
 lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/bsdapp/eal/eal_pci.c +1 -1
index 30f0232..61e8921 100644
@@ -432,7 +432,7 @@ error:
 int
 rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev)
 {
-	struct rte_pci_id *id_table;
+	const struct rte_pci_id *id_table;
 	int ret;
 
 	for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
Signature · 1 line
2.1.0
#1 lore raw
Quoted 6 lines
Fixes 6065355a "pci: make device id tables const"

Following the above commit, compilation on FreeBSD with clang was broken, giving the error message:

.../lib/librte_eal/bsdapp/eal/eal_pci.c:438:16: fatal error: assigning to

Quoted 8 lines
      'struct rte_pci_id *' from 'const struct rte_pci_id *' discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
        for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
                      ^ ~~~~~~~~~~~~

This patch fixes the issue by adding "const" to the type of id_table.

Applied, thanks