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

* Re: [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask'
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Zheng Zengkai @ 2020-11-28  1:29 UTC (permalink / raw)
  To: anton; +Cc: linux-ntfs-dev, linux-kernel

Ping...
> 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.

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

* Re: [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask'
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Anton Altaparmakov @ 2020-12-08  8:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-ntfs-dev, LKML, Zheng Zengkai

Hi Andrew,

Can you please apply this?

Thanks a lot in advance!

Hi Zheng,

Thank you for the patch!

Best regards,

	Anton

> On 12 Mar 2020, at 04:13, Zheng Zengkai <zhengzengkai@huawei.com> wrote:
> 
> 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>
> Acked-by: Anton Altaparmakov <anton@tuxera.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
> 


-- 
Anton Altaparmakov <anton at tuxera.com> (replace at with @)
Lead in File System Development, Tuxera Inc., http://www.tuxera.com/
Linux NTFS maintainer


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

* Re: [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask'
  2020-12-08  8:24 ` Anton Altaparmakov
@ 2020-12-10  2:36   ` Andrew Morton
  2020-12-10  2:51     ` Anton Altaparmakov
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2020-12-10  2:36 UTC (permalink / raw)
  To: Anton Altaparmakov; +Cc: linux-ntfs-dev, LKML, Zheng Zengkai

On Tue, 8 Dec 2020 08:24:02 +0000 Anton Altaparmakov <anton@tuxera.com> wrote:

> Can you please apply this?
>
> ...
>
> > --- 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.

https://lore.kernel.org/lkml/1604821092-54631-1-git-send-email-alex.shi@linux.alibaba.com/
addressed this?


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

* Re: [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask'
  2020-12-10  2:36   ` Andrew Morton
@ 2020-12-10  2:51     ` Anton Altaparmakov
  2020-12-10  6:17       ` Zheng Zengkai
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Altaparmakov @ 2020-12-10  2:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-ntfs-dev, LKML, Zheng Zengkai

Hi Andrew,

Ah, oops!  Thank you and apologies.  Quite right the alternative patch was even better.  No need to apply this patch after all...

Zheng, the log_page_mask variable was removed altogether so your patch no longer makes sense.

Best regards,

	Anton

> On 10 Dec 2020, at 02:36, Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> On Tue, 8 Dec 2020 08:24:02 +0000 Anton Altaparmakov <anton@tuxera.com> wrote:
> 
>> Can you please apply this?
>> 
>> ...
>> 
>>> --- 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.
> 
> https://lore.kernel.org/lkml/1604821092-54631-1-git-send-email-alex.shi@linux.alibaba.com/
> addressed this?
> 


-- 
Anton Altaparmakov <anton at tuxera.com> (replace at with @)
Lead in File System Development, Tuxera Inc., http://www.tuxera.com/
Linux NTFS maintainer


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

* Re: [PATCH -next] fs/ntfs: fix set but not used variable 'log_page_mask'
  2020-12-10  2:51     ` Anton Altaparmakov
@ 2020-12-10  6:17       ` Zheng Zengkai
  0 siblings, 0 replies; 6+ messages in thread
From: Zheng Zengkai @ 2020-12-10  6:17 UTC (permalink / raw)
  To: Anton Altaparmakov, Andrew Morton; +Cc: linux-ntfs-dev, LKML

Hi Anton and Andrew,

> Hi Andrew,
>
> Ah, oops!  Thank you and apologies.  Quite right the alternative patch was even better.  No need to apply this patch after all...
>
> Zheng, the log_page_mask variable was removed altogether so your patch no longer makes sense.
>
> Best regards,
>
> 	Anton
>
>> On 10 Dec 2020, at 02:36, Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>> On Tue, 8 Dec 2020 08:24:02 +0000 Anton Altaparmakov <anton@tuxera.com> wrote:
>>
>>> Can you please apply this?
>>>
>>> ...
>>>
>>>> --- 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.
>> https://lore.kernel.org/lkml/1604821092-54631-1-git-send-email-alex.shi@linux.alibaba.com/
>> addressed this?
>>
It's ok, thank you all the same!


^ permalink raw reply	[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.