Skip to contentSkip to conversation

qla1280: endianess annotations

SCSI Jeff Garzik 2 participants 2 messages Sep 8, 2005 1 message not in the archive SCSI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 10 lines · Linux Kernel Mailing List
drivers/scsi/qla1280.c +1 -1
@@ -1546,7 +1546,7 @@ qla1280_return_status(struct response * 
 	int host_status = DID_ERROR;
 	uint16_t comp_status = le16_to_cpu(sts->comp_status);
 	uint16_t state_flags = le16_to_cpu(sts->state_flags);
-	uint16_t residual_length = le16_to_cpu(sts->residual_length);
+	uint16_t residual_length = le32_to_cpu(sts->residual_length);
 	uint16_t scsi_status = le16_to_cpu(sts->scsi_status);

[...]

drivers/scsi/qla1280.c

Quoted 6 lines
drivers/scsi/qla1280.c +5 -0
+	__le16 status_flags;	/* Status flags. */
+	__le16 time;		/* Time. */
+	__le16 req_sense_length;/* Request sense data length. */
+	__le32 residual_length;	/* Residual transfer length. */
+	__le16 reserved[4];
 	uint8_t req_sense_data[32];	/* Request sense data. */

This isn't merely an endian annotation.

Is this a size fix, from 16 to 32, or a typo? If its not a typo, shouldn't the variable be declared 'uint32_t residual_length'?

Jeff

#2 lore raw
Quoted 21 lines · Jeff Garzik
Quoted 10 lines · Linux Kernel Mailing List
drivers/scsi/qla1280.c +1 -1
@@ -1546,7 +1546,7 @@ qla1280_return_status(struct response * 
 	int host_status = DID_ERROR;
 	uint16_t comp_status = le16_to_cpu(sts->comp_status);
 	uint16_t state_flags = le16_to_cpu(sts->state_flags);
-	uint16_t residual_length = le16_to_cpu(sts->residual_length);
+	uint16_t residual_length = le32_to_cpu(sts->residual_length);
 	uint16_t scsi_status = le16_to_cpu(sts->scsi_status);

[...]

Quoted 6 lines
drivers/scsi/qla1280.c +5 -0
+	__le16 status_flags;	/* Status flags. */
+	__le16 time;		/* Time. */
+	__le16 req_sense_length;/* Request sense data length. */
+	__le32 residual_length;	/* Residual transfer length. */
+	__le16 reserved[4];
	uint8_t req_sense_data[32];	/* Request sense data. */

This isn't merely an endian annotation.

Quoted 2 lines

Is this a size fix, from 16 to 32, or a typo? If its not a typo, shouldn't the variable be declared 'uint32_t residual_length'?

It's a typo-fix. The variable is 32bits in hardware. Declaring it in 32bit in software might make sense, but isn't that important. Feel free to send a patch if you care enough.