[PATCH 1/2] block:t10-pi: remove redundant Type2 check during t10 PI verify

Ankit Kumar posted 2 patches 2 years, 4 months ago
There is a newer version of this series
[PATCH 1/2] block:t10-pi: remove redundant Type2 check during t10 PI verify
Posted by Ankit Kumar 2 years, 4 months ago
T10_PI_TYPE2_PROTECTION is neither used to generate nor verify
crc and ip. Remove this redundant check.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
---
 block/t10-pi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/t10-pi.c b/block/t10-pi.c
index 914d8cddd43a..bf0bba01417f 100644
--- a/block/t10-pi.c
+++ b/block/t10-pi.c
@@ -64,8 +64,7 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter,
 		struct t10_pi_tuple *pi = iter->prot_buf;
 		__be16 csum;
 
-		if (type == T10_PI_TYPE1_PROTECTION ||
-		    type == T10_PI_TYPE2_PROTECTION) {
+		if (type == T10_PI_TYPE1_PROTECTION) {
 			if (pi->app_tag == T10_PI_APP_ESCAPE)
 				goto next;
 
-- 
2.25.1
Re: [PATCH 1/2] block:t10-pi: remove redundant Type2 check during t10 PI verify
Posted by Martin K. Petersen 2 years, 4 months ago
Ankit,

> T10_PI_TYPE2_PROTECTION is neither used to generate nor verify
> crc and ip. Remove this redundant check.

Remnant from when this code was moved out of SCSI.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering