Thread (123 messages) 123 messages, 7 authors, 2017-07-08

Re: [PATCH v5 1/7] bus: fix bus name registration

From: Gaëtan Rivet <hidden>
Date: 2017-07-04 01:05:16

On Tue, Jun 27, 2017 at 09:19:14PM +0200, Jan Blunck wrote:
On Wed, Jun 21, 2017 at 1:30 AM, Gaetan Rivet [off-list ref] wrote:
quoted
The default bus registration function should not result in buses
registering with double quotes within their names.
This is breaking expectations with users. All other registration macro
pass the names through the stringification. The problem is that you
pass in the name as a string already ("PCI" instead of PCI).
I agree that it does not behave as expected.
However, all buses are currently using it this way, and this
cannot be fixed if maintainers keep using public define's
for their bus name.
quoted
Fixes: a97725791eec ("bus: introduce bus abstraction")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <redacted>
---
 lib/librte_eal/common/include/rte_bus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h
index fcc2442..b220299 100644
--- a/lib/librte_eal/common/include/rte_bus.h
+++ b/lib/librte_eal/common/include/rte_bus.h
@@ -254,7 +254,7 @@ struct rte_bus *rte_bus_find_by_device(const struct rte_device *dev);
 #define RTE_REGISTER_BUS(nm, bus) \
 static void __attribute__((constructor(101), used)) businitfn_ ##nm(void) \
 {\
-       (bus).name = RTE_STR(nm);\
+       (bus).name = nm;\
        rte_bus_register(&bus); \
 }

--
2.1.4
-- 
Gaëtan Rivet
6WIND
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help