From b85e1b92350a225aa848c70246ec5f6eefc93dd0 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 18 Feb 2007 19:28:29 +0000 Subject: Tiny size optimisation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12396 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'firmware/drivers') 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 } /* */ }; 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); -- cgit v1.2.3