Re: [PATCH v7 2/6] bus: introduce parsing functionality
From: santosh <hidden>
Date: 2017-07-06 09:19:59
Hi Gaetan, On Wednesday 05 July 2017 05:25 AM, Gaetan Rivet wrote:
quoted hunk ↗ jump to hunk
This operation can be used either to validate that a device representation can be understood by a bus, as well as store the resulting specialized device representation in any format determined by the bus. Signed-off-by: Gaetan Rivet <redacted> --- lib/librte_eal/common/include/rte_bus.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index 773b0d7..aebf57e 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h@@ -138,6 +138,26 @@ typedef int (*rte_bus_plug_t)(struct rte_device *dev, typedef int (*rte_bus_unplug_t)(struct rte_device *dev); /** + * Bus specific parsing function. + * Validates the syntax used in the textual representation of a device, + * If the syntax is valid and ``addr`` is not NULL, writes the bus-specific + * device representation to ``addr``. + * + * @param[in] name + * device textual description + * + * @param[out] addr + * device information location address, into which parsed info + * should be written. If NULL, nothing should be written, which + * is not an error. + *
r / is not a error/ is valid?
+ * @return + * 0 if parsing was successful. + * !0 for any error. + */ +typedef int (*rte_bus_parse_t)(const char *name, void *addr); +
_parse handler in _common_vdev or common_pci file return boolean value i.e..0 for success and 1 for error, right? if so then !0 for any error would be like '1' for error case.. make sense?