[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
- To: Jan Beulich <JBeulich@xxxxxxxx>
- From: chenbaodong <chenbaodong@xxxxxxxxxx>
- Date: Mon, 3 Jun 2019 18:00:18 +0800
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 03 Jun 2019 10:00:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 6/3/19 17:27, Jan Beulich wrote:
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 ..."?
Yes, fixed, see v1.
@@ -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.
Yes, fixed, see v1.
--- 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 - ...
Yes, fixed, see v1.
+#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).
Yes, fixed, see v1.
Jan
.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|