Skip to content

Commit

Permalink
pata_sis: mark most const data static as well
Browse files Browse the repository at this point in the history
This pushes timing and other values into preinitialized read-only data
sections rather than being inlined into the code. None of these
functions are called more than a handful of times, so reducing code size
makes sense.

Signed-off-by: Dan McGee <[email protected]>
Signed-off-by: Jeff Garzik <[email protected]>
  • Loading branch information
toofishes authored and Jeff Garzik committed Oct 8, 2011
1 parent 14004f0 commit c03a476
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/ata/pata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
u8 t1, t2;
int speed = adev->pio_mode - XFER_PIO_0;

const u8 active[] = { 0x00, 0x07, 0x04, 0x03, 0x01 };
const u8 recovery[] = { 0x00, 0x06, 0x04, 0x03, 0x03 };
static const u8 active[] = { 0x00, 0x07, 0x04, 0x03, 0x01 };
static const u8 recovery[] = { 0x00, 0x06, 0x04, 0x03, 0x03 };

sis_set_fifo(ap, adev);

Expand Down Expand Up @@ -267,7 +267,7 @@ static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev)
int port = sis_old_port_base(adev);
int speed = adev->pio_mode - XFER_PIO_0;

const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 };
static const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 };

sis_set_fifo(ap, adev);

Expand All @@ -293,14 +293,14 @@ static void sis_133_set_piomode (struct ata_port *ap, struct ata_device *adev)
u32 t1;
int speed = adev->pio_mode - XFER_PIO_0;

const u32 timing133[] = {
static const u32 timing133[] = {
0x28269000, /* Recovery << 24 | Act << 16 | Ini << 12 */
0x0C266000,
0x04263000,
0x0C0A3000,
0x05093000
};
const u32 timing100[] = {
static const u32 timing100[] = {
0x1E1C6000, /* Recovery << 24 | Act << 16 | Ini << 12 */
0x091C4000,
0x031C2000,
Expand Down Expand Up @@ -341,8 +341,8 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
int drive_pci = sis_old_port_base(adev);
u16 timing;

const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
const u16 udma_bits[] = { 0xE000, 0xC000, 0xA000 };
static const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
static const u16 udma_bits[] = { 0xE000, 0xC000, 0xA000 };

pci_read_config_word(pdev, drive_pci, &timing);

Expand Down Expand Up @@ -381,8 +381,8 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
u16 timing;

/* MWDMA 0-2 and UDMA 0-5 */
const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000, 0x8000 };
static const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
static const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000, 0x8000 };

pci_read_config_word(pdev, drive_pci, &timing);

Expand Down Expand Up @@ -419,7 +419,7 @@ static void sis_100_set_dmamode (struct ata_port *ap, struct ata_device *adev)
int drive_pci = sis_old_port_base(adev);
u8 timing;

const u8 udma_bits[] = { 0x8B, 0x87, 0x85, 0x83, 0x82, 0x81};
static const u8 udma_bits[] = { 0x8B, 0x87, 0x85, 0x83, 0x82, 0x81};

pci_read_config_byte(pdev, drive_pci + 1, &timing);

Expand Down

0 comments on commit c03a476

Please sign in to comment.