ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
* [PATCH] ocfs2: Remove redundant 0 value initialization
@ 2025-08-19  3:29 Liao Yuanhong
  2025-08-19  9:11 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Liao Yuanhong @ 2025-08-19  3:29 UTC (permalink / raw)
  To: Mark Fasheh, Joel Becker, Joseph Qi, Andrew Morton, Daniel Yang,
	Al Viro, Christian Brauner, Dmitry Antipov,
	open list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2), open list
  Cc: Liao Yuanhong

The o2hb_region struct is already zeroed by kzalloc(). It's redundant to
initialize reg->hr_region_num to 0.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 fs/ocfs2/cluster/heartbeat.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 724350925aff..18150dabdff9 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -2011,7 +2011,6 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
 	}
 
 	spin_lock(&o2hb_live_lock);
-	reg->hr_region_num = 0;
 	if (o2hb_global_heartbeat_active()) {
 		reg->hr_region_num = find_first_zero_bit(o2hb_region_bitmap,
 							 O2NM_MAX_REGIONS);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ocfs2: Remove redundant 0 value initialization
  2025-08-19  3:29 [PATCH] ocfs2: Remove redundant 0 value initialization Liao Yuanhong
@ 2025-08-19  9:11 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2025-08-19  9:11 UTC (permalink / raw)
  To: Liao Yuanhong, ocfs2-devel
  Cc: LKML, Al Viro, Andrew Morton, Christian Brauner, Daniel Yang,
	Dmitry Antipov, Joel Becker, Joseph Qi, Mark Fasheh

> The o2hb_region struct is already zeroed by kzalloc(). It's redundant to
> initialize reg->hr_region_num to 0.

See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc2#n94

Regards,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-19  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19  3:29 [PATCH] ocfs2: Remove redundant 0 value initialization Liao Yuanhong
2025-08-19  9:11 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).