aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_qstor.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2005-10-21 01:46:02 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-21 02:05:31 -0400
commit0420dd121d395e76f6b80fe232e7b4bc6a046f18 (patch)
treeb45a5dbd3e1dda91eb92f856063146563f8f6f2a /drivers/scsi/sata_qstor.c
parentb181d3b0121e141cb410ea3126b4dbe4f8e1751a (diff)
[PATCH] enum safety (sata_qstor)
sata_qstor strays into a nasty area - gcc handling of wide enums is full of bugs that got fixed between gcc versions creating portability nightmare. Single-member enums are safe, so are ones that stay within the range of int or unsigned int. Anything beyond that is asking for trouble. Declaration of constants split in two enums, taking the ~0UL one into a separate enum. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/sata_qstor.c')
-rw-r--r--drivers/scsi/sata_qstor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index ffcdeb68641c..e1c1dae27c52 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -51,8 +51,6 @@ enum {
51 QS_PRD_BYTES = QS_MAX_PRD * 16, 51 QS_PRD_BYTES = QS_MAX_PRD * 16,
52 QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES, 52 QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES,
53 53
54 QS_DMA_BOUNDARY = ~0UL,
55
56 /* global register offsets */ 54 /* global register offsets */
57 QS_HCF_CNFG3 = 0x0003, /* host configuration offset */ 55 QS_HCF_CNFG3 = 0x0003, /* host configuration offset */
58 QS_HID_HPHY = 0x0004, /* host physical interface info */ 56 QS_HID_HPHY = 0x0004, /* host physical interface info */
@@ -101,6 +99,10 @@ enum {
101 board_2068_idx = 0, /* QStor 4-port SATA/RAID */ 99 board_2068_idx = 0, /* QStor 4-port SATA/RAID */
102}; 100};
103 101
102enum {
103 QS_DMA_BOUNDARY = ~0UL
104};
105
104typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t; 106typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t;
105 107
106struct qs_port_priv { 108struct qs_port_priv {