diff mbox series

[02/11] md-bitmap: initialize variables at declaration time in md_bitmap_file_unmap

Message ID 20230615064840.629492-3-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/11] md-bitmap: set BITMAP_WRITE_ERROR in write_sb_page | expand

Commit Message

Christoph Hellwig June 15, 2023, 6:48 a.m. UTC
Just a small tidyup to prepare for bigger changes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/md-bitmap.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Hannes Reinecke June 15, 2023, 6:56 a.m. UTC | #1
On 6/15/23 08:48, Christoph Hellwig wrote:
> Just a small tidyup to prepare for bigger changes.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/md/md-bitmap.c | 12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index d8469720fac23f..0b2d8933cbc75e 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -842,14 +842,10 @@ static int md_bitmap_storage_alloc(struct bitmap_storage *store,
>   
>   static void md_bitmap_file_unmap(struct bitmap_storage *store)
>   {
> -	struct page **map, *sb_page;
> -	int pages;
> -	struct file *file;
> -
> -	file = store->file;
> -	map = store->filemap;
> -	pages = store->file_pages;
> -	sb_page = store->sb_page;
> +	struct file *file = store->file;
> +	struct page *sb_page = store->sb_page;
> +	struct page **map = store->filemap;
> +	int pages = store->file_pages;
>   
>   	while (pages--)
>   		if (map[pages] != sb_page) /* 0 is sb_page, release it below */
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Johannes Thumshirn June 15, 2023, 2:23 p.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Himanshu Madhani June 15, 2023, 5:05 p.m. UTC | #3
> On Jun 14, 2023, at 11:48 PM, Christoph Hellwig <hch@lst.de> wrote:
> 
> Just a small tidyup to prepare for bigger changes.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/md/md-bitmap.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index d8469720fac23f..0b2d8933cbc75e 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -842,14 +842,10 @@ static int md_bitmap_storage_alloc(struct bitmap_storage *store,
> 
> static void md_bitmap_file_unmap(struct bitmap_storage *store)
> {
> - struct page **map, *sb_page;
> - int pages;
> - struct file *file;
> -
> - file = store->file;
> - map = store->filemap;
> - pages = store->file_pages;
> - sb_page = store->sb_page;
> + struct file *file = store->file;
> + struct page *sb_page = store->sb_page;
> + struct page **map = store->filemap;
> + int pages = store->file_pages;
> 
> while (pages--)
> if (map[pages] != sb_page) /* 0 is sb_page, release it below */
> -- 
> 2.39.2
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
diff mbox series

Patch

diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index d8469720fac23f..0b2d8933cbc75e 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -842,14 +842,10 @@  static int md_bitmap_storage_alloc(struct bitmap_storage *store,
 
 static void md_bitmap_file_unmap(struct bitmap_storage *store)
 {
-	struct page **map, *sb_page;
-	int pages;
-	struct file *file;
-
-	file = store->file;
-	map = store->filemap;
-	pages = store->file_pages;
-	sb_page = store->sb_page;
+	struct file *file = store->file;
+	struct page *sb_page = store->sb_page;
+	struct page **map = store->filemap;
+	int pages = store->file_pages;
 
 	while (pages--)
 		if (map[pages] != sb_page) /* 0 is sb_page, release it below */