Skip to contentSkip to conversation

scsi: ses: Fix unsigned comparison with less than zero

PATCH Applied Jiapeng Chong 2 participants 2 messages Sep 24, 2021 – Sep 29, 2021 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ses: Fix unsigned comparison with less than zero

Fix the following coccicheck warning:

./drivers/scsi/ses.c:137:10-16: WARNING: Unsigned expression compared with zero: result > 0.

---
 drivers/scsi/ses.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ses.c +1 -1
index 43e6822..0a1734f 100644
@@ -118,7 +118,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
 static int ses_send_diag(struct scsi_device *sdev, int page_code,
 			 void *buf, int bufflen)
 {
-	u32 result;
+	int result;
 
 	unsigned char cmd[] = {
 		SEND_DIAGNOSTIC,
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 6 lines · Jiapeng Chong

Fix the following coccicheck warning:

./drivers/scsi/ses.c:137:10-16: WARNING: Unsigned expression compared with zero: result > 0.

Applied to 5.15/scsi-fixes, thanks!

[1/1] scsi: ses: Fix unsigned comparison with less than zero

      https://git.kernel.org/mkp/scsi/c/dd689ed5aa90
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering