All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask'
@ 2020-03-12  4:13 Zheng Zengkai
  2020-11-28  1:29 ` Zheng Zengkai
  2020-12-08  8:24 ` Anton Altaparmakov
  0 siblings, 2 replies; 6+ messages in thread
From: Zheng Zengkai @ 2020-03-12  4:13 UTC (permalink / raw)
  To: anton; +Cc: linux-ntfs-dev, linux-kernel, zhengzengkai

Fixes gcc '-Wunused-but-set-variable' warning:

fs/ntfs/logfile.c: In function ntfs_check_logfile:
fs/ntfs/logfile.c:481:21:
 warning: variable log_page_mask set but not used [-Wunused-but-set-variable]

Actually log_page_mask can be used to replace 'log_page_size - 1' as it is set.

Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
---
 fs/ntfs/logfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index a0c40f1be7ac..c35fcf389369 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -507,7 +507,7 @@ bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
 	 * optimize log_page_size and log_page_bits into constants.
 	 */
 	log_page_bits = ntfs_ffs(log_page_size) - 1;
-	size &= ~(s64)(log_page_size - 1);
+	size &= ~(s64)(log_page_mask);
 	/*
 	 * Ensure the log file is big enough to store at least the two restart
 	 * pages and the minimum number of log record pages.
-- 
2.20.1


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

end of thread, other threads:[~2020-12-10  6:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  4:13 [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask' Zheng Zengkai
2020-11-28  1:29 ` Zheng Zengkai
2020-12-08  8:24 ` Anton Altaparmakov
2020-12-10  2:36   ` Andrew Morton
2020-12-10  2:51     ` Anton Altaparmakov
2020-12-10  6:17       ` Zheng Zengkai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.