From: Akinobu Mita <akinobu.mita@gmail.com>
To: FUJITA Tomonori <tomof@acm.org>
Cc: alan@redhat.com, James.Bottomley@HansenPartnership.com,
linux-scsi@vger.kernel.org, hch@lst.de, dledford@redhat.com,
fujita.tomonori@lab.ntt.co.jp
Subject: Re: [PATCH] a100u2w: fix bitmap lookup routine
Date: Thu, 20 Mar 2008 18:36:28 +0900 [thread overview]
Message-ID: <20080320093626.GB30888@APFDCB5C> (raw)
In-Reply-To: <20080320093448.GA30888@APFDCB5C>
On Thu, Mar 20, 2008 at 06:34:48PM +0900, Akinobu Mita wrote:
> This is incremental patch to the original bugfix patch.
This is the original bugfix for the reference
Subject: [patch 1/2] 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 not set, it always returns 33-th orc_scb even though the 33-th bit
is not set.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Alan Cox <alan@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Doug Ledford <dledford@redhat.com>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
---
drivers/scsi/a100u2w.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Index: 2.6-rc/drivers/scsi/a100u2w.c
===================================================================
--- 2.6-rc.orig/drivers/scsi/a100u2w.c
+++ 2.6-rc/drivers/scsi/a100u2w.c
@@ -674,12 +674,13 @@ static struct orc_scb *__orc_alloc_scb(s
for (index = 0; index < 32; index++) {
if ((host->allocation_map[channel][i] >> index) & 0x01) {
host->allocation_map[channel][i] &= ~(1 << index);
- break;
+ idx = index + 32 * i;
+ /*
+ * Translate the index to a structure instance
+ */
+ return host->scb_virt + idx;
}
}
- idx = index + 32 * i;
- /* Translate the index to a structure instance */
- return (struct orc_scb *) ((unsigned long) host->scb_virt + (idx * sizeof(struct orc_scb)));
}
return NULL;
}
next prev parent reply other threads:[~2008-03-20 9:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-17 12:32 [PATCH] a100u2w: fix bitmap lookup routine Akinobu Mita
2008-03-17 13:45 ` Akinobu Mita
2008-03-17 14:46 ` James Bottomley
2008-03-17 16:04 ` Alan Cox
2008-03-19 14:24 ` Alan Cox
2008-03-20 4:56 ` FUJITA Tomonori
2008-03-20 9:34 ` Akinobu Mita
2008-03-20 9:36 ` Akinobu Mita [this message]
2008-03-20 14:12 ` Alan Cox
2008-03-20 14:17 ` James Bottomley
2008-03-20 16:34 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080320093626.GB30888@APFDCB5C \
--to=akinobu.mita@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alan@redhat.com \
--cc=dledford@redhat.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=tomof@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.