diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-02-18 19:28:29 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-02-18 19:28:29 +0000 |
commit | b85e1b92350a225aa848c70246ec5f6eefc93dd0 (patch) | |
tree | 27a18e3dcc9b4ff4f05893ac433e4b3ab831b604 /firmware/drivers/ata.c | |
parent | 7c55b67cf4a9059b725021db032e277b74784377 (diff) |
Tiny size optimisation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12396 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 54a1b12143..21376ab9a7 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -845,7 +845,7 @@ static int set_multiple_mode(int sectors) static int set_features(void) { - struct { + static struct { unsigned char id_word; unsigned char id_bit; unsigned char subcommand; @@ -855,7 +855,6 @@ static int set_features(void) { 83, 9, 0x42, 0x80 }, /* acoustic management: lowest noise */ { 82, 6, 0xaa, 0 }, /* enable read look-ahead */ { 83, 14, 0x03, 0 }, /* force PIO mode */ - { 0, 0, 0, 0 } /* <end of list> */ }; int i; int pio_mode = 2; @@ -877,7 +876,7 @@ static int set_features(void) return -1; } - for (i=0; features[i].id_word; i++) { + for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) { if (identify_info[features[i].id_word] & (1 << features[i].id_bit)) { SET_REG(ATA_FEATURE, features[i].subcommand); SET_REG(ATA_NSECTOR, features[i].parameter); |