lkml.org 
[lkml]   [2021]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH-V2] fs/btrfs: Fix uninitialized variable
Date
The variable 'zone' is uninitialized which
introduce some build warning.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Khaled ROMDHANI <khaledromdhani216@gmail.com>
---
v2: catch the init as an assertion
---
fs/btrfs/zoned.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 432509f4b3ac..70c0b1b2ff04 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -144,7 +144,7 @@ static inline u32 sb_zone_number(int shift, int mirror)
case 1: zone = 1ULL << (BTRFS_SB_LOG_FIRST_SHIFT - shift); break;
case 2: zone = 1ULL << (BTRFS_SB_LOG_SECOND_SHIFT - shift); break;
default:
- ASSERT(zone);
+ ASSERT(zone = 0);
break;
}

base-commit: c05b2a58c9ed11bd753f1e64695bd89da715fbaa
--
2.17.1

\
 
 \ /
  Last update: 2021-04-27 19:17    [W:0.044 / U:2.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site