From: Bart Van Assche Date: Fri, 25 Aug 2017 20:46:35 +0000 (-0700) Subject: scsi: sd: Remove a useless comparison X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=830cc351bc3c7f867daf92f17992bca34a647d8c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git scsi: sd: Remove a useless comparison This patch avoids that gcc reports the following warning when building with W=1: drivers/scsi/sd.c:315:10: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] if (val >= 0 && val <= T10_PI_TYPE3_PROTECTION) Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig Cc: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8b3d7994e182..7c0f9eb5a5fd 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -312,7 +312,7 @@ protection_type_store(struct device *dev, struct device_attribute *attr, if (err) return err; - if (val >= 0 && val <= T10_PI_TYPE3_PROTECTION) + if (val <= T10_PI_TYPE3_PROTECTION) sdkp->protection_type = val; return count;