[PATCH] JFS: Remove redundant 0 value initialization

Liao Yuanhong posted 1 patch 1 month, 2 weeks ago
fs/jfs/jfs_logmgr.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] JFS: Remove redundant 0 value initialization
Posted by Liao Yuanhong 1 month, 2 weeks ago
The jfs_log struct is already zeroed by kzalloc(). It's redundant to
initialize dummy_log->base to 0.

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

diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 270808b6219b..b343c5ea1159 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1199,7 +1199,6 @@ static int open_dummy_log(struct super_block *sb)
 		init_waitqueue_head(&dummy_log->syncwait);
 		dummy_log->no_integrity = 1;
 		/* Make up some stuff */
-		dummy_log->base = 0;
 		dummy_log->size = 1024;
 		rc = lmLogInit(dummy_log);
 		if (rc) {
-- 
2.34.1
Re: [Jfs-discussion] [PATCH] JFS: Remove redundant 0 value initialization
Posted by Dave Kleikamp 2 weeks, 2 days ago
Applied.

Thanks,
Shaggy

On 8/18/25 10:28PM, Liao Yuanhong via Jfs-discussion wrote:
> The jfs_log struct is already zeroed by kzalloc(). It's redundant to
> initialize dummy_log->base to 0.
> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
>   fs/jfs/jfs_logmgr.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
> index 270808b6219b..b343c5ea1159 100644
> --- a/fs/jfs/jfs_logmgr.c
> +++ b/fs/jfs/jfs_logmgr.c
> @@ -1199,7 +1199,6 @@ static int open_dummy_log(struct super_block *sb)
>   		init_waitqueue_head(&dummy_log->syncwait);
>   		dummy_log->no_integrity = 1;
>   		/* Make up some stuff */
> -		dummy_log->base = 0;
>   		dummy_log->size = 1024;
>   		rc = lmLogInit(dummy_log);
>   		if (rc) {
Re: [PATCH] JFS: Remove redundant 0 value initialization
Posted by Markus Elfring 1 month, 2 weeks ago
> The jfs_log struct is already zeroed by kzalloc(). It's redundant to
> initialize dummy_log->base 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