summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa_cmd.h
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-02-25 14:03:22 -0600
committerJames Bottomley <James.Bottomley@suse.de>2010-03-03 18:37:08 +0530
commitdb61bfcfe2a68dc71402c270686cd73b80971efc (patch)
tree2888902956cd899d924070f559f6fcac8595d490 /drivers/scsi/hpsa_cmd.h
parentff9fea94546afa2a496c15354533f06088347f6e (diff)
downloadlinux-db61bfcfe2a68dc71402c270686cd73b80971efc.tar.gz
linux-db61bfcfe2a68dc71402c270686cd73b80971efc.tar.bz2
linux-db61bfcfe2a68dc71402c270686cd73b80971efc.zip
[SCSI] hpsa: Clarify calculation of padding for commandlist structure
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa_cmd.h')
-rw-r--r--drivers/scsi/hpsa_cmd.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h
index 3e0abdf76689..43b6f1cffe34 100644
--- a/drivers/scsi/hpsa_cmd.h
+++ b/drivers/scsi/hpsa_cmd.h
@@ -313,12 +313,18 @@ struct CommandList {
void *scsi_cmd;
/* on 64 bit architectures, to get this to be 32-byte-aligned
- * it so happens we need no padding, on 32 bit systems,
- * we need 8 bytes of padding. This does that.
+ * it so happens we need PAD_64 bytes of padding, on 32 bit systems,
+ * we need PAD_32 bytes of padding (see below). This does that.
+ * If it happens that 64 bit and 32 bit systems need different
+ * padding, PAD_32 and PAD_64 can be set independently, and.
+ * the code below will do the right thing.
*/
-#define COMMANDLIST_PAD ((8 - sizeof(long))/4 * 8)
+#define IS_32_BIT ((8 - sizeof(long))/4)
+#define IS_64_BIT (!IS_32_BIT)
+#define PAD_32 (8)
+#define PAD_64 (0)
+#define COMMANDLIST_PAD (IS_32_BIT * PAD_32 + IS_64_BIT * PAD_64)
u8 pad[COMMANDLIST_PAD];
-
};
/* Configuration Table Structure */