Skip to content

Commit

Permalink
[SCSI] sd: DIF: Fix tagging on platforms with signed char
Browse files Browse the repository at this point in the history
Switch tag arrays to u8 to prevent problems on platforms with signed
char.

Reported-by: Tim LaBerge <tim.laberge@Quantum.Com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Jan 5, 2009
1 parent 10da518 commit becce74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/scsi/sd_dif.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int sd_dif_type1_verify_ip(struct blk_integrity_exchg *bix)
static void sd_dif_type1_set_tag(void *prot, void *tag_buf, unsigned int sectors)
{
struct sd_dif_tuple *sdt = prot;
char *tag = tag_buf;
u8 *tag = tag_buf;
unsigned int i, j;

for (i = 0, j = 0 ; i < sectors ; i++, j += 2, sdt++) {
Expand All @@ -154,7 +154,7 @@ static void sd_dif_type1_set_tag(void *prot, void *tag_buf, unsigned int sectors
static void sd_dif_type1_get_tag(void *prot, void *tag_buf, unsigned int sectors)
{
struct sd_dif_tuple *sdt = prot;
char *tag = tag_buf;
u8 *tag = tag_buf;
unsigned int i, j;

for (i = 0, j = 0 ; i < sectors ; i++, j += 2, sdt++) {
Expand Down Expand Up @@ -256,7 +256,7 @@ static int sd_dif_type3_verify_ip(struct blk_integrity_exchg *bix)
static void sd_dif_type3_set_tag(void *prot, void *tag_buf, unsigned int sectors)
{
struct sd_dif_tuple *sdt = prot;
char *tag = tag_buf;
u8 *tag = tag_buf;
unsigned int i, j;

for (i = 0, j = 0 ; i < sectors ; i++, j += 6, sdt++) {
Expand All @@ -269,7 +269,7 @@ static void sd_dif_type3_set_tag(void *prot, void *tag_buf, unsigned int sectors
static void sd_dif_type3_get_tag(void *prot, void *tag_buf, unsigned int sectors)
{
struct sd_dif_tuple *sdt = prot;
char *tag = tag_buf;
u8 *tag = tag_buf;
unsigned int i, j;

for (i = 0, j = 0 ; i < sectors ; i++, j += 2, sdt++) {
Expand Down

0 comments on commit becce74

Please sign in to comment.