On Thu, Sep 19, 2019 at 03:57:19PM +0200, Arnd Bergmann wrote:
Changing the switch() statement to symbolic constants madeI didn't have the break in my local patch but I think this is more
the compiler (at least clang-9, did not check gcc) notice that
there is one enum value that is not handled here:
block/t10-pi.c:62:11: error: enumeration value 'T10_PI_TYPE0_PROTECTION' not handled in switch [-Werror,-Wswitch]
Add another case for the missing value and do nothing there
based on the assumption that the code was working correctly
already.
Fixes: 9b2061b1a262 ("block: use symbolic constants for t10_pi type")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
block/t10-pi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/t10-pi.c b/block/t10-pi.c
index 0c0120a672f9..055fac923946 100644
--- a/block/t10-pi.c
+++ b/block/t10-pi.c
@@ -60,6 +60,8 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter,
__be16 csum;
switch (type) {
+ case T10_PI_TYPE0_PROTECTION:
+ break;
case T10_PI_TYPE1_PROTECTION:
case T10_PI_TYPE2_PROTECTION:
if (pi->app_tag == T10_PI_APP_ESCAPE)
--
2.20.0
correct based on the description of the enums. Like Nick pointed out,
there is no functional change because this value is not used in this
file.
Reviewed-by: Nathan Chancellor <natechancellor@xxxxxxxxx>