* [patch iproute2] devlink: finish queue.h to list.h transition
@ 2019-08-05 9:56 Jiri Pirko
2019-08-05 18:54 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2019-08-05 9:56 UTC (permalink / raw)
To: netdev; +Cc: stephen, dsahern, slyfox, ayal, mlxsw
From: Jiri Pirko <jiri@mellanox.com>
Loose the "q" from the names and name the structure fields in the same
way rest of the code does. Also, fix list_add arg order which leads
to segfault.
Fixes: 33267017faf1 ("iproute2: devlink: port from sys/queue.h to list.h")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
devlink/devlink.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 0ea401ae432a..91c85dc1de73 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -5978,35 +5978,36 @@ static int fmsg_value_show(struct dl *dl, int type, struct nlattr *nl_data)
return MNL_CB_OK;
}
-struct nest_qentry {
+struct nest_entry {
int attr_type;
- struct list_head nest_entries;
+ struct list_head list;
};
struct fmsg_cb_data {
struct dl *dl;
uint8_t value_type;
- struct list_head qhead;
+ struct list_head entry_list;
};
static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data,
uint8_t *attr_value, bool insert)
{
- struct nest_qentry *entry = NULL;
+ struct nest_entry *entry;
if (insert) {
- entry = malloc(sizeof(struct nest_qentry));
+ entry = malloc(sizeof(struct nest_entry));
if (!entry)
return -ENOMEM;
entry->attr_type = *attr_value;
- list_add(&fmsg_data->qhead, &entry->nest_entries);
+ list_add(&entry->list, &fmsg_data->entry_list);
} else {
- if (list_empty(&fmsg_data->qhead))
+ if (list_empty(&fmsg_data->entry_list))
return MNL_CB_ERROR;
- entry = list_first_entry(&fmsg_data->qhead, struct nest_qentry, nest_entries);
+ entry = list_first_entry(&fmsg_data->entry_list,
+ struct nest_entry, list);
*attr_value = entry->attr_type;
- list_del(&entry->nest_entries);
+ list_del(&entry->list);
free(entry);
}
return MNL_CB_OK;
@@ -6115,7 +6116,7 @@ static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags)
return err;
data.dl = dl;
- INIT_LIST_HEAD(&data.qhead);
+ INIT_LIST_HEAD(&data.entry_list);
err = _mnlg_socket_sndrcv(dl->nlg, nlh, cmd_fmsg_object_cb, &data);
return err;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch iproute2] devlink: finish queue.h to list.h transition
2019-08-05 9:56 [patch iproute2] devlink: finish queue.h to list.h transition Jiri Pirko
@ 2019-08-05 18:54 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2019-08-05 18:54 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, dsahern, slyfox, ayal, mlxsw
On Mon, 5 Aug 2019 11:56:56 +0200
Jiri Pirko <jiri@resnulli.us> wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> Loose the "q" from the names and name the structure fields in the same
> way rest of the code does. Also, fix list_add arg order which leads
> to segfault.
>
> Fixes: 33267017faf1 ("iproute2: devlink: port from sys/queue.h to list.h")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-05 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-05 9:56 [patch iproute2] devlink: finish queue.h to list.h transition Jiri Pirko
2019-08-05 18:54 ` Stephen Hemminger
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).