diff options
Diffstat (limited to 'drivers/scsi/hpsa_cmd.h')
| -rw-r--r-- | drivers/scsi/hpsa_cmd.h | 14 |
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 { | |||
| 313 | void *scsi_cmd; | 313 | void *scsi_cmd; |
| 314 | 314 | ||
| 315 | /* on 64 bit architectures, to get this to be 32-byte-aligned | 315 | /* on 64 bit architectures, to get this to be 32-byte-aligned |
| 316 | * it so happens we need no padding, on 32 bit systems, | 316 | * it so happens we need PAD_64 bytes of padding, on 32 bit systems, |
| 317 | * we need 8 bytes of padding. This does that. | 317 | * we need PAD_32 bytes of padding (see below). This does that. |
| 318 | * If it happens that 64 bit and 32 bit systems need different | ||
| 319 | * padding, PAD_32 and PAD_64 can be set independently, and. | ||
| 320 | * the code below will do the right thing. | ||
| 318 | */ | 321 | */ |
| 319 | #define COMMANDLIST_PAD ((8 - sizeof(long))/4 * 8) | 322 | #define IS_32_BIT ((8 - sizeof(long))/4) |
| 323 | #define IS_64_BIT (!IS_32_BIT) | ||
| 324 | #define PAD_32 (8) | ||
| 325 | #define PAD_64 (0) | ||
| 326 | #define COMMANDLIST_PAD (IS_32_BIT * PAD_32 + IS_64_BIT * PAD_64) | ||
| 320 | u8 pad[COMMANDLIST_PAD]; | 327 | u8 pad[COMMANDLIST_PAD]; |
| 321 | |||
| 322 | }; | 328 | }; |
| 323 | 329 | ||
| 324 | /* Configuration Table Structure */ | 330 | /* Configuration Table Structure */ |
