diff -upr linux-2.6.20-org/drivers/scsi/eata.c linux-2.6.20/drivers/scsi/eata.c --- linux-2.6.20-org/drivers/scsi/eata.c 2007-02-04 20:44:54.000000000 +0200 +++ linux-2.6.20/drivers/scsi/eata.c 2007-02-24 15:43:08.000000000 +0200 @@ -2089,8 +2089,8 @@ int eata2x_bios_param(struct scsi_device return 0; } -static void sort(unsigned long sk[], unsigned int da[], unsigned int n, - unsigned int rev) +static void eata_sort(unsigned long sk[], unsigned int da[], unsigned int n, + unsigned int rev) { unsigned int i, j, k, y; unsigned long x; @@ -2098,14 +2098,17 @@ static void sort(unsigned long sk[], uns for (i = 0; i < n - 1; i++) { k = i; - for (j = k + 1; j < n; j++) - if (rev) { + if (rev) { + for (j = k + 1; j < n; j++) { if (sk[j] > sk[k]) k = j; - } else { + } + } else { + for (j = k + 1; j < n; j++) { if (sk[j] < sk[k]) k = j; } + } if (k != i) { x = sk[k]; @@ -2116,8 +2119,6 @@ static void sort(unsigned long sk[], uns da[i] = y; } } - - return; } static int reorder(struct hostdata *ha, unsigned long cursec, @@ -2194,7 +2195,7 @@ static int reorder(struct hostdata *ha, rev = 0; if (!((rev && r) || (!rev && s))) - sort(sl, il, n_ready, rev); + eata_sort(sl, il, n_ready, rev); if (!input_only) for (n = 0; n < n_ready; n++) { @@ -2214,7 +2215,7 @@ static int reorder(struct hostdata *ha, } if (overlap) - sort(pl, il, n_ready, 0); + eata_sort(pl, il, n_ready, 0); if (link_statistics) { if (cursec > sl[0])