diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-03-17 08:32:02 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-03-20 10:19:25 -0400 |
commit | 28aef2f7d9415b881c9145ab9b2c1c234064a243 (patch) | |
tree | dba23def5ed8533e337b8c147ebc9e9a6881f752 /drivers/scsi/a100u2w.c | |
parent | 4d1566ed2100d074ccc654e5cf2e44cdea3a01d0 (diff) |
[SCSI] a100u2w: fix bitmap lookup routine
This patch is only compile tested.
It seems that bitmap lookup routine for allocation_map in
a100u2w driver is simply wrong.
It cannot lookup more than first 32 bits. If all first 32 bits
are set, it just returns 33-th orc_scb even though the 33-th bit
is not set.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Tested-by: Alan Cox <alan@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/a100u2w.c')
-rw-r--r-- | drivers/scsi/a100u2w.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index f608d4a1d6da..792b2e807bf3 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c | |||
@@ -674,12 +674,13 @@ static struct orc_scb *__orc_alloc_scb(struct orc_host * host) | |||
674 | for (index = 0; index < 32; index++) { | 674 | for (index = 0; index < 32; index++) { |
675 | if ((host->allocation_map[channel][i] >> index) & 0x01) { | 675 | if ((host->allocation_map[channel][i] >> index) & 0x01) { |
676 | host->allocation_map[channel][i] &= ~(1 << index); | 676 | host->allocation_map[channel][i] &= ~(1 << index); |
677 | break; | 677 | idx = index + 32 * i; |
678 | /* | ||
679 | * Translate the index to a structure instance | ||
680 | */ | ||
681 | return host->scb_virt + idx; | ||
678 | } | 682 | } |
679 | } | 683 | } |
680 | idx = index + 32 * i; | ||
681 | /* Translate the index to a structure instance */ | ||
682 | return (struct orc_scb *) ((unsigned long) host->scb_virt + (idx * sizeof(struct orc_scb))); | ||
683 | } | 684 | } |
684 | return NULL; | 685 | return NULL; |
685 | } | 686 | } |