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

Re: [PATCH v8 6/6] devargs: parse bus info

From: Thomas Monjalon <hidden>
Date: 2017-07-08 20:31:41

07/07/2017 10:31, Gaëtan Rivet:
On Thu, Jul 06, 2017 at 05:45:02PM -0700, Stephen Hemminger wrote:
quoted
On Fri,  7 Jul 2017 02:03:12 +0200
Gaetan Rivet [off-list ref] wrote:
quoted
+static int
+bus_name_cmp(const struct rte_bus *bus, const void *_name)
+{
+	const char *name = _name;
+
+	return strncmp(bus->name, name,
+		       strlen(bus->name));
I don't think you need the _name variable hack. C will cast the argument to strncmp
You're right, and it was just habit. Usually I prefer giving a type to a
generic parameter, but in this case it may be too trivial.
Simplified when applying.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help