Skip to content

Commit

Permalink
[SCSI] scsi_dh: suppress comparison warning
Browse files Browse the repository at this point in the history
On Mon, 2008-09-22 at 14:56 -0700, akpm@linux-foundation.org wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
>
> s390:
>
> drivers/scsi/device_handler/scsi_dh_emc.c: In function 'parse_sp_info_reply':
> drivers/scsi/device_handler/scsi_dh_emc.c:179: warning: comparison is always false due to limited range of data type
>
> because chars are unsigned, I assume.

Fix by making csdev->buffer explicitly an unsigned char and dropping
the < 0 test.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
James Bottomley authored and James Bottomley committed Oct 3, 2008
1 parent 650849d commit 7ae628d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/device_handler/scsi_dh_emc.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct clariion_dh_data {
/*
* I/O buffer for both MODE_SELECT and INQUIRY commands.
*/
char buffer[CLARIION_BUFFER_SIZE];
unsigned char buffer[CLARIION_BUFFER_SIZE];
/*
* SCSI sense buffer for commands -- assumes serial issuance
* and completion sequence of all commands for same multipath.
Expand Down Expand Up @@ -176,7 +176,7 @@ static int parse_sp_info_reply(struct scsi_device *sdev,
err = SCSI_DH_DEV_TEMP_BUSY;
goto out;
}
if (csdev->buffer[4] < 0 || csdev->buffer[4] > 2) {
if (csdev->buffer[4] > 2) {
/* Invalid buffer format */
sdev_printk(KERN_NOTICE, sdev,
"%s: invalid VPD page 0xC0 format\n",
Expand Down

0 comments on commit 7ae628d

Please sign in to comment.