bus/fslmc: fix find device start condition
PATCH 1/1 bus/fslmc: fix find device start condition
If start is set and a device before it matches the data, this device is returned.
---
Hi Shreyansh, Hemant,
Sorry, I did not test this.
I found this issue while working on vdev and PCI.
There is a better way to iterate on devices [1], but the gain is really minimal and the implementation slightly more complex. I preferred to avoid complex, as I could not test this patch.
Regards,
[1]: http://dpdk.org/ml/archives/dev/2018-March/092906.html
drivers/bus/fslmc/fslmc_bus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/bus/fslmc/fslmc_bus.c +3 -2
@@ -301,8 +301,9 @@ rte_fslmc_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,struct rte_dpaa2_device *dev; TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) { -if (start && &dev->device == start) { - start =NULL ;/* starting point found */ +if (start !=NULL ) { +if (&dev->device == start) + start =NULL ;/* starting point found */ continue ; }
Signature · 1 line
2.11.0
Quoted 16 lines · Gaetan Rivet
If start is set and a device before it matches the data, this device is returned.
Fixes c7fe1eea8a74 ("bus: simplify finding starting point")Cc Hemant Agrawal <[email protected]>Cc Shreyansh Jain <[email protected]>Signed-off-by Gaetan Rivet <[email protected]>---
Hi Shreyansh, Hemant,
Sorry, I did not test this.
I found this issue while working on vdev and PCI.
Quoted 8 lines
There is a better way to iterate on devices [1], but the gain is really minimal and the implementation slightly more complex. I preferred to avoid complex, as I could not test this patch.
Regards,
I think this change should suffice here. Thanks.
(On a side note, it seems compilation using clang is failing for this patch [1] though it is not related to this change. I will look into that)
[1] http://dpdk.org/ml/archives/test-report/2018-March/044684.html
Thomas Monjalon
Applied23/03/2018 09:52, Shreyansh Jain:
Quoted 28 lines · Gaetan Rivet
Quoted 16 lines
If start is set and a device before it matches the data, this device is returned.
Fixes c7fe1eea8a74 ("bus: simplify finding starting point")Cc Hemant Agrawal <[email protected]>Cc Shreyansh Jain <[email protected]>Signed-off-by Gaetan Rivet <[email protected]>---
Hi Shreyansh, Hemant,
Sorry, I did not test this.
I found this issue while working on vdev and PCI.Quoted 8 lines
There is a better way to iterate on devices [1], but the gain is really minimal and the implementation slightly more complex. I preferred to avoid complex, as I could not test this patch.
Regards,
I think this change should suffice here. Thanks.
Quoted 7 lines
(On a side note, it seems compilation using clang is failing for this patch [1] though it is not related to this change. I will look into that)
[1] http://dpdk.org/ml/archives/test-report/2018-March/044684.html
Acked-by Shreyansh Jain <[email protected]>
Applied, thanks