lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190919135725.1287963-1-arnd@arndb.de>
Date:   Thu, 19 Sep 2019 15:57:19 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     Arnd Bergmann <arnd@...db.de>, Christoph Hellwig <hch@....de>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Max Gurtovoy <maxg@...lanox.com>,
        Chaitanya Kulkarni <chaitanya.kulkarni@....com>,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        clang-built-linux@...glegroups.com
Subject: [PATCH] block: t10-pi: fix -Wswitch warning

Changing the switch() statement to symbolic constants made
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@...db.de>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ