Commit 44bdc2fb authored by Colin Ian King's avatar Colin Ian King Committed by Jens Axboe

ata: pata_artop: make arrays static const, makes object smaller

Don't populate the const arrays on the stack but instead make them
static. Makes the object code smaller by 292 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
   6988	   3132	    128	  10248	   2808	drivers/ata/pata_artop.o

After:
   text	   data	    bss	    dec	    hex	filename
   6536	   3292	    128	   9956	   26e4	drivers/ata/pata_artop.o

(gcc version 9.2.1, amd64)
Acked-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent dee58fe8
...@@ -100,7 +100,7 @@ static void artop6210_load_piomode(struct ata_port *ap, struct ata_device *adev, ...@@ -100,7 +100,7 @@ static void artop6210_load_piomode(struct ata_port *ap, struct ata_device *adev,
{ {
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int dn = adev->devno + 2 * ap->port_no; int dn = adev->devno + 2 * ap->port_no;
const u16 timing[2][5] = { static const u16 timing[2][5] = {
{ 0x0000, 0x000A, 0x0008, 0x0303, 0x0301 }, { 0x0000, 0x000A, 0x0008, 0x0303, 0x0301 },
{ 0x0700, 0x070A, 0x0708, 0x0403, 0x0401 } { 0x0700, 0x070A, 0x0708, 0x0403, 0x0401 }
...@@ -154,7 +154,7 @@ static void artop6260_load_piomode (struct ata_port *ap, struct ata_device *adev ...@@ -154,7 +154,7 @@ static void artop6260_load_piomode (struct ata_port *ap, struct ata_device *adev
{ {
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int dn = adev->devno + 2 * ap->port_no; int dn = adev->devno + 2 * ap->port_no;
const u8 timing[2][5] = { static const u8 timing[2][5] = {
{ 0x00, 0x0A, 0x08, 0x33, 0x31 }, { 0x00, 0x0A, 0x08, 0x33, 0x31 },
{ 0x70, 0x7A, 0x78, 0x43, 0x41 } { 0x70, 0x7A, 0x78, 0x43, 0x41 }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment