2023-02-06 08:46:30

by Li zeming

[permalink] [raw]
Subject: [PATCH] fs-writeback: remove unnecessary ‘false’ values from wakeup_bdi

wakeup_bdi does not need to be initialized. It is used after being
assigned.

Signed-off-by: Li zeming <[email protected]>
---
fs/fs-writeback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 6fba5a52127b..2d3191d9c736 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2486,7 +2486,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
*/
if (!was_dirty) {
struct list_head *dirty_list;
- bool wakeup_bdi = false;
+ bool wakeup_bdi;

inode->dirtied_when = jiffies;
if (dirtytime)
--
2.18.2



2023-02-17 14:41:52

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH] fs-writeback: remove unnecessary ‘false’ values from wakeup_bdi

On Wed 08-02-23 09:17:42, Li zeming wrote:
> wakeup_bdi does not need to be initialized. It is used after being
> assigned.
>
> Signed-off-by: Li zeming <[email protected]>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

Honza

> ---
> fs/fs-writeback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 6fba5a52127b..2d3191d9c736 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -2486,7 +2486,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
> */
> if (!was_dirty) {
> struct list_head *dirty_list;
> - bool wakeup_bdi = false;
> + bool wakeup_bdi;
>
> inode->dirtied_when = jiffies;
> if (dirtytime)
> --
> 2.18.2
>
--
Jan Kara <[email protected]>
SUSE Labs, CR