• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: コミット

2.4.36-stable kernel tree


コミットメタ情報

リビジョン8f9ef6ad57f199f566bec80cb93bde0153604471 (tree)
日時2006-11-26 07:14:14
作者Willy Tarreau <w@1wt....>
コミッターWilly Tarreau

ログメッセージ

[PATCH] ps2esdi: typo may cause premature timeout

The stop condition in the following statement causes an immediate
break out of the loop because ESDI_TIMEOUT=0xf000 and the result
of the !(inb()) expression can only be either 0 or 1, which means
that i never gets counted down.

for (i = ESDI_TIMEOUT;
i & !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL);
i--);

The obvious cause is the use of "i & !" instead of "i && !". This
was already fixed in 2.6.

Signed-off-by: Willy Tarreau <w@1wt.eu>

変更サマリ

差分

--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -741,7 +741,7 @@ static void ps2esdi_geometry_int_handler(u_int int_ret_code)
741741 drive_num = int_ret_code >> 5;
742742 switch (int_ret_code & 0xf) {
743743 case INT_CMD_COMPLETE:
744- for (i = ESDI_TIMEOUT; i & !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
744+ for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
745745 if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
746746 printk("%s: timeout reading status word\n", DEVICE_NAME);
747747 outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
@@ -876,7 +876,7 @@ static void ps2esdi_normal_interrupt_handler(u_int int_ret_code)
876876 break;
877877
878878 case INT_CMD_COMPLETE:
879- for (i = ESDI_TIMEOUT; i & !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
879+ for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
880880 if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
881881 printk("%s: timeout reading status word\n", DEVICE_NAME);
882882 outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
旧リポジトリブラウザで表示