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

Re: [Xen-devel] [PATCH RESEND] xen: notifier: refine 'notifier_head', use 'list_head' directly



>>> On 03.06.19 at 03:33, <chenbaodong@xxxxxxxxxx> wrote:
> 'notifier_block' can be replaced with 'list_head' when used for
> 'notifier_head', this make the a little more clear.

I guess you mean "... makes the code a little ..."?

> @@ -71,16 +71,16 @@ int notifier_call_chain(
>  {
>      int ret = NOTIFY_DONE;
>      struct list_head *cursor;
> -    struct notifier_block *nb;
> +    struct notifier_block *nb = NULL;
>      bool_t reverse = !!(val & NOTIFY_REVERSE);
>  
> -    cursor = &(pcursor && *pcursor ? *pcursor : &nh->head)->chain;
> +    cursor = (pcursor && *pcursor ? &(*pcursor)->chain : &nh->head);

The outermost parentheses are now not really needed anymore.

> --- a/xen/include/xen/notifier.h
> +++ b/xen/include/xen/notifier.h
> @@ -29,13 +29,12 @@ struct notifier_block {
>  };
>  
>  struct notifier_head {
> -    struct notifier_block head;
> +    struct list_head head;
>  };
>  
> -#define NOTIFIER_INIT(name) { .head.chain = LIST_HEAD_INIT(name.head.chain) }

Note the blanks immediately inside the figure braces - ...

> +#define NOTIFIER_HEAD(name)                                                  
>   \
> +  struct notifier_head name = {.head = LIST_HEAD_INIT(name.head)}

... please don't break such style aspects, unless you know
it is something that needs fixing (for being in violation of our
style guidelines).

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.