summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/ata.c5
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)
845 845
846static int set_features(void) 846static int set_features(void)
847{ 847{
848 struct { 848 static struct {
849 unsigned char id_word; 849 unsigned char id_word;
850 unsigned char id_bit; 850 unsigned char id_bit;
851 unsigned char subcommand; 851 unsigned char subcommand;
@@ -855,7 +855,6 @@ static int set_features(void)
855 { 83, 9, 0x42, 0x80 }, /* acoustic management: lowest noise */ 855 { 83, 9, 0x42, 0x80 }, /* acoustic management: lowest noise */
856 { 82, 6, 0xaa, 0 }, /* enable read look-ahead */ 856 { 82, 6, 0xaa, 0 }, /* enable read look-ahead */
857 { 83, 14, 0x03, 0 }, /* force PIO mode */ 857 { 83, 14, 0x03, 0 }, /* force PIO mode */
858 { 0, 0, 0, 0 } /* <end of list> */
859 }; 858 };
860 int i; 859 int i;
861 int pio_mode = 2; 860 int pio_mode = 2;
@@ -877,7 +876,7 @@ static int set_features(void)
877 return -1; 876 return -1;
878 } 877 }
879 878
880 for (i=0; features[i].id_word; i++) { 879 for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) {
881 if (identify_info[features[i].id_word] & (1 << features[i].id_bit)) { 880 if (identify_info[features[i].id_word] & (1 << features[i].id_bit)) {
882 SET_REG(ATA_FEATURE, features[i].subcommand); 881 SET_REG(ATA_FEATURE, features[i].subcommand);
883 SET_REG(ATA_NSECTOR, features[i].parameter); 882 SET_REG(ATA_NSECTOR, features[i].parameter);