Skip to contentSkip to conversation

notify: explicit shutdown initialization

PATCH In review Fabian Frederick 2 participants 2 messages May 12, 2020 – May 13, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/6 notify: explicit shutdown initialization

kzalloc should already do it but explicitly initialize group shutdown variable to false.

---
 fs/notify/group.c | 1 +
 1 file changed, 1 insertion(+)
fs/notify/group.c +1 -0
index 133f723aca07..f2cba2265061 100644
@@ -130,6 +130,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
 	INIT_LIST_HEAD(&group->notification_list);
 	init_waitqueue_head(&group->notification_waitq);
 	group->max_events = UINT_MAX;
+	group->shutdown = false;
 
 	mutex_init(&group->mark_mutex);
 	INIT_LIST_HEAD(&group->marks_list);
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 4 lines · Fabian Frederick

kzalloc should already do it but explicitly initialize group shutdown variable to false.

I don't think this patch makes sence. false is defined to be 0. kzalloc is there exactly so that we don't have to initialize fields that should be zero.

Honza

Quoted 19 lines
---
 fs/notify/group.c | 1 +
 1 file changed, 1 insertion(+)
fs/notify/group.c +1 -0
index 133f723aca07..f2cba2265061 100644
@@ -130,6 +130,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
 	INIT_LIST_HEAD(&group->notification_list);
 	init_waitqueue_head(&group->notification_waitq);
 	group->max_events = UINT_MAX;
+	group->shutdown = false;
 
 	mutex_init(&group->mark_mutex);
 	INIT_LIST_HEAD(&group->marks_list);
Signature · 1 line
2.26.2
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR