diff mbox series

scsi: ses: Fix unsigned comparison with less than zero

Message ID 1632477113-90378-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Headers show
Series scsi: ses: Fix unsigned comparison with less than zero | expand

Commit Message

Jiapeng Chong Sept. 24, 2021, 9:51 a.m. UTC
Fix the following coccicheck warning:

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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/scsi/ses.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen Sept. 29, 2021, 4:19 a.m. UTC | #1
On Fri, 24 Sep 2021 17:51:53 +0800, Jiapeng Chong wrote:

> 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
diff mbox series

Patch

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 43e6822..0a1734f 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -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,