Re: [PATCH rdma-core 3/5] verbs: Use ccan list.h instead of open coding lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 01, 2017 at 09:05:33AM +0200, Nicolas Morey-Chaisemartin wrote:
> > For ibv_sysfs_dev, ibv_driver_name and ibv_driver internal structs. ccan
> > lists are easier to understand and use than the open coded versions.
> >
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
> >  libibverbs/init.c | 62 +++++++++++++++++++++++++------------------------------
> >  1 file changed, 28 insertions(+), 34 deletions(-)
> >
> > diff --git a/libibverbs/init.c b/libibverbs/init.c
> [...]
> > @@ -156,7 +156,8 @@ static int find_sysfs_devs(struct ibv_sysfs_dev **tmp_sysfs_dev_list)
> >  		else
> >  			sysfs_dev->abi_ver = 0;
> >  
> > -		*tmp_sysfs_dev_list = sysfs_dev;
> > +		list_node_init(&sysfs_dev->entry);
> > +		list_add(tmp_sysfs_dev_list, &sysfs_dev->entry);
> 
> I don't think you need to init the node.
> According to the header file: " * The new list_node does not need to be initialized; it will be overwritten."

Right you are, all fixed.

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux