* [dpdk-dev] [PATCH 0/3] eal: minor cleanups
@ 2017-07-06 15:28 Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 1/3] eal: simplify finding starting point Stephen Hemminger
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Stephen Hemminger @ 2017-07-06 15:28 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Some minor stuff found while reviewing EAL to support VMBUS.
Stephen Hemminger (3):
eal: simplify finding starting point
fslmc: simplfy find_device
eal: fix spelling in comment
drivers/bus/fslmc/fslmc_bus.c | 6 ++----
lib/librte_eal/common/eal_common_bus.c | 6 ++----
lib/librte_eal/common/eal_common_pci.c | 8 +++-----
lib/librte_eal/common/eal_common_vdev.c | 6 ++----
4 files changed, 9 insertions(+), 17 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 1/3] eal: simplify finding starting point
2017-07-06 15:28 [dpdk-dev] [PATCH 0/3] eal: minor cleanups Stephen Hemminger
@ 2017-07-06 15:28 ` Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 2/3] fslmc: simplfy find_device Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2017-07-06 15:28 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
A separate boolean variable is not necessary when searching for
starting point in find_device. Just use the passed argument
as its own flag value.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/eal_common_bus.c | 6 ++----
lib/librte_eal/common/eal_common_pci.c | 6 ++----
lib/librte_eal/common/eal_common_vdev.c | 6 ++----
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
index 87b0c6e6fa03..997009d2b8d0 100644
--- a/lib/librte_eal/common/eal_common_bus.c
+++ b/lib/librte_eal/common/eal_common_bus.c
@@ -154,12 +154,10 @@ rte_bus_find(const struct rte_bus *start, rte_bus_cmp_t cmp,
const void *data)
{
struct rte_bus *bus = NULL;
- bool start_found = !start;
TAILQ_FOREACH(bus, &rte_bus_list, next) {
- if (!start_found) {
- if (bus == start)
- start_found = 1;
+ if (start && bus == start) {
+ start = NULL; /* starting point found */
continue;
}
if (cmp(bus, data) == 0)
diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 5ee100e67374..7ed259b09cd0 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -491,12 +491,10 @@ pci_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
const void *data)
{
struct rte_pci_device *dev;
- bool start_found = !start;
FOREACH_DEVICE_ON_PCIBUS(dev) {
- if (!start_found) {
- if (&dev->device == start)
- start_found = 1;
+ if (start && &dev->device == start) {
+ start = NULL; /* starting point found */
continue;
}
if (cmp(&dev->device, data) == 0)
diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c
index baf3c5bfa23f..9ec62f4d4dea 100644
--- a/lib/librte_eal/common/eal_common_vdev.c
+++ b/lib/librte_eal/common/eal_common_vdev.c
@@ -342,12 +342,10 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
const void *data)
{
struct rte_vdev_device *dev;
- bool start_found = !start;
TAILQ_FOREACH(dev, &vdev_device_list, next) {
- if (start_found == 0) {
- if (&dev->device == start)
- start_found = 1;
+ if (start && &dev->device == start) {
+ start = NULL;
continue;
}
if (cmp(&dev->device, data) == 0)
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/3] fslmc: simplfy find_device
2017-07-06 15:28 [dpdk-dev] [PATCH 0/3] eal: minor cleanups Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 1/3] eal: simplify finding starting point Stephen Hemminger
@ 2017-07-06 15:28 ` Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 3/3] eal: fix spelling in comment Stephen Hemminger
2017-07-08 17:29 ` [dpdk-dev] [PATCH 0/3] eal: minor cleanups Thomas Monjalon
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2017-07-06 15:28 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Stephen Hemminger
Don't need separate flag value.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
drivers/bus/fslmc/fslmc_bus.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 1e3bbeeb0a66..88b969c073a0 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -111,12 +111,10 @@ rte_fslmc_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
const void *data)
{
struct rte_dpaa2_device *dev;
- bool start_found = !start;
TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
- if (!start_found) {
- if (&dev->device == start)
- start_found = 1;
+ if (start && &dev->device == start)
+ start = NULL; /* starting point found */
continue;
}
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 3/3] eal: fix spelling in comment
2017-07-06 15:28 [dpdk-dev] [PATCH 0/3] eal: minor cleanups Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 1/3] eal: simplify finding starting point Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 2/3] fslmc: simplfy find_device Stephen Hemminger
@ 2017-07-06 15:28 ` Stephen Hemminger
2017-07-08 17:29 ` [dpdk-dev] [PATCH 0/3] eal: minor cleanups Thomas Monjalon
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2017-07-06 15:28 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Minor spelling error in comment.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/eal_common_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 7ed259b09cd0..15991b5e9640 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -300,7 +300,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
/*
* Find the pci device specified by pci address, then invoke probe function of
- * the driver of the devive.
+ * the driver of the device.
*/
int
rte_pci_probe_one(const struct rte_pci_addr *addr)
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] eal: minor cleanups
2017-07-06 15:28 [dpdk-dev] [PATCH 0/3] eal: minor cleanups Stephen Hemminger
` (2 preceding siblings ...)
2017-07-06 15:28 ` [dpdk-dev] [PATCH 3/3] eal: fix spelling in comment Stephen Hemminger
@ 2017-07-08 17:29 ` Thomas Monjalon
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-07-08 17:29 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
06/07/2017 17:28, Stephen Hemminger:
> Some minor stuff found while reviewing EAL to support VMBUS.
>
> Stephen Hemminger (3):
> eal: simplify finding starting point
> fslmc: simplfy find_device
> eal: fix spelling in comment
Applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-08 17:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06 15:28 [dpdk-dev] [PATCH 0/3] eal: minor cleanups Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 1/3] eal: simplify finding starting point Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 2/3] fslmc: simplfy find_device Stephen Hemminger
2017-07-06 15:28 ` [dpdk-dev] [PATCH 3/3] eal: fix spelling in comment Stephen Hemminger
2017-07-08 17:29 ` [dpdk-dev] [PATCH 0/3] eal: minor cleanups Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).