From 09968e5049b4b9a47413327c56f254aa2812bbc2 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 18 Oct 2018 14:55:41 -0700 Subject: scsi: 3w-sas: 3w-9xxx: Use unsigned char for cdb Clang warns a few times: drivers/scsi/3w-sas.c:386:11: warning: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Wconstant-conversion] cdb[4] = TW_ALLOCATION_LENGTH; /* allocation length */ ~ ^~~~~~~~~~~~~~~~~~~~ Update cdb's type to unsigned char, which matches the type of the cdb member in struct TW_Command_Apache. Link: https://github.com/ClangBuiltLinux/linux/issues/158 Signed-off-by: Nathan Chancellor Acked-by: Adam Radford Signed-off-by: Martin K. Petersen --- drivers/scsi/3w-sas.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/3w-sas.c') diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 266bdac75304..480cf82700e9 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -287,7 +287,9 @@ static int twl_post_command_packet(TW_Device_Extension *tw_dev, int request_id) } /* End twl_post_command_packet() */ /* This function hands scsi cdb's to the firmware */ -static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry_ISO *sglistarg) +static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, + unsigned char *cdb, int use_sg, + TW_SG_Entry_ISO *sglistarg) { TW_Command_Full *full_command_packet; TW_Command_Apache *command_packet; @@ -372,7 +374,7 @@ out: /* This function will read the aen queue from the isr */ static int twl_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) { - char cdb[TW_MAX_CDB_LEN]; + unsigned char cdb[TW_MAX_CDB_LEN]; TW_SG_Entry_ISO sglist[1]; TW_Command_Full *full_command_packet; int retval = 1; @@ -554,7 +556,7 @@ out: static int twl_aen_drain_queue(TW_Device_Extension *tw_dev, int no_check_reset) { int request_id = 0; - char cdb[TW_MAX_CDB_LEN]; + unsigned char cdb[TW_MAX_CDB_LEN]; TW_SG_Entry_ISO sglist[1]; int finished = 0, count = 0; TW_Command_Full *full_command_packet; -- cgit