diff options
author | marius <marius@FreeBSD.org> | 2012-03-21 16:59:39 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2012-03-21 16:59:39 +0000 |
commit | cc444f6cf55f23db4d16615150883d872ffb5bd2 (patch) | |
tree | ecf4732c0a19395313044e11b9f3ed72b03a4eea /sys/dev/ata/chipsets/ata-via.c | |
parent | 20d817657d8db6ea88d3c8f0ab6ea12ee1a7934d (diff) | |
download | FreeBSD-src-cc444f6cf55f23db4d16615150883d872ffb5bd2.zip FreeBSD-src-cc444f6cf55f23db4d16615150883d872ffb5bd2.tar.gz |
- First pass at const'ifying ata(4) as appropriate.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers
MFC after: 1 week
Diffstat (limited to 'sys/dev/ata/chipsets/ata-via.c')
-rw-r--r-- | sys/dev/ata/chipsets/ata-via.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/ata/chipsets/ata-via.c b/sys/dev/ata/chipsets/ata-via.c index f83f2a8..956a4e2 100644 --- a/sys/dev/ata/chipsets/ata-via.c +++ b/sys/dev/ata/chipsets/ata-via.c @@ -82,7 +82,6 @@ static int ata_via_sata_status(device_t dev); #define VIAAHCI 0x08 #define VIASATA 0x10 - /* * VIA Technologies Inc. chipset support functions */ @@ -90,7 +89,7 @@ static int ata_via_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static struct ata_chip_id ids[] = + static const struct ata_chip_id const ids[] = {{ ATA_VIA82C586, 0x02, VIA33, 0x00, ATA_UDMA2, "82C586B" }, { ATA_VIA82C586, 0x00, VIA33, 0x00, ATA_WDMA2, "82C586" }, { ATA_VIA82C596, 0x12, VIA66, VIACLK, ATA_UDMA4, "82C596B" }, @@ -114,7 +113,7 @@ ata_via_probe(device_t dev) { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; - static struct ata_chip_id new_ids[] = + static const struct ata_chip_id const new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, { ATA_VIA6420, 0x00, 7, 0x00, ATA_SA150, "6420" }, { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, @@ -328,8 +327,10 @@ ata_via_new_setmode(device_t dev, int target, int mode) if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) { int piomode; - u_int8_t pio_timings[] = { 0xa8, 0x65, 0x65, 0x32, 0x20 }; - u_int8_t dma_timings[] = { 0xee, 0xe8, 0xe6, 0xe4, 0xe2, 0xe1, 0xe0 }; + static const uint8_t pio_timings[] = + { 0xa8, 0x65, 0x65, 0x32, 0x20 }; + static const uint8_t dma_timings[] = + { 0xee, 0xe8, 0xe6, 0xe4, 0xe2, 0xe1, 0xe0 }; /* This chip can't do WDMA. */ if (mode >= ATA_WDMA0 && mode < ATA_UDMA0) @@ -355,8 +356,9 @@ ata_via_old_setmode(device_t dev, int target, int mode) int devno = (ch->unit << 1) + target; int reg = 0x53 - devno; int piomode; - uint8_t timings[] = { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; - uint8_t modes[][7] = { + static const uint8_t timings[] = + { 0xa8, 0x65, 0x42, 0x22, 0x20, 0xa8, 0x22, 0x20 }; + static const uint8_t modes[][7] = { { 0xc2, 0xc1, 0xc0, 0x00, 0x00, 0x00, 0x00 }, /* VIA ATA33 */ { 0xee, 0xec, 0xea, 0xe9, 0xe8, 0x00, 0x00 }, /* VIA ATA66 */ { 0xf7, 0xf6, 0xf4, 0xf2, 0xf1, 0xf0, 0x00 }, /* VIA ATA100 */ |