Re: [PATCH v13 07/12] livepatch: Use lists to manage patches, objects and functions

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

 



On Wed 2018-10-17 15:31:07, Josh Poimboeuf wrote:
> On Mon, Oct 15, 2018 at 02:37:08PM +0200, Petr Mladek wrote:
> > +static int klp_init_lists(struct klp_patch *patch)
> > +{
> > +	struct klp_object *obj;
> > +	struct klp_func *func;
> > +
> > +	INIT_LIST_HEAD(&patch->obj_list);
> > +	if (!patch->objs)
> > +		return -EINVAL;
> > +
> > +	klp_for_each_object_static(patch, obj) {
> > +		list_add(&obj->node, &patch->obj_list);
> > +
> > +		INIT_LIST_HEAD(&obj->func_list);
> > +		if (!obj->funcs)
> > +			return -EINVAL;
> > +
> > +		klp_for_each_func_static(obj, func)
> > +			list_add(&func->node, &obj->func_list);
> > +	}
> > +
> > +	return 0;
> > +}
> 
> It may be ever-so-slightly better to use list_add_tail() instead of
> list_add(), so the list order matches the array order.  I doubt the
> ordering really matters, but you never know.  It could for example make
> debugging a little easier in some scenarios.

Makes sense. Will do in v14.

Best Regareds,
Petr



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux