From: Joe Perches <joe@perches.com>
To: Hank Janssen <hjanssen@sailtheuniverse.com>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@driverdev.osuosl.org, virtualization@lists.osdl.org,
Haiyang Zhang <haiyangz@microsoft.com>
Subject: Re: [PATCH 2/5] staging: hv: Fixed lockup problem with bounce_buffer scatter list - RESEND
Date: Wed, 01 Sep 2010 15:45:28 -0700 [thread overview]
Message-ID: <1283381128.1797.238.camel@Joe-Laptop> (raw)
In-Reply-To: <4C7D601B.3060708@sailtheuniverse.com>
On Tue, 2010-08-31 at 13:03 -0700, Hank Janssen wrote:
> On 09/01/2010 09:38 AM, Joe Perches wrote:
> > On Tue, 2010-08-31 at 11:13 -0700, Hank Janssen wrote:
> >> diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
> >> - request->DataBuffer.PfnArray[i] =
> >> - page_to_pfn(sg_page((&sgl[i])));
> >> + request->DataBuffer.PfnArray[i] =
> >> + page_to_pfn(sg_page((&sgl[i])));
> > I did a bit of a doubletake reading this last change.
> > This isn't actually a part of your fix and it introduces
> > a whitespace error.
> I will resubmit this patch and clean up the whitespace error.
>
> When change the code I normally also change the indentation to the
> correct format for that area of the code. That is how the whitespace
> snuck in there.
At least mention the whitespace change in the description
or perhaps use a different coding style for readability
that uses temporaries to avoid the split lines.
Something like:
drivers/staging/hv/storvsc_drv.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 075b61b..874891b 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -611,6 +611,8 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
struct storvsc_driver_object *storvsc_drv_obj =
&storvsc_drv_ctx->drv_obj;
struct hv_storvsc_request *request;
+ struct hv_multipage_buffer *rmpb;
+ u64 *rmpba;
struct storvsc_cmd_request *cmd_request;
unsigned int request_size = 0;
int i;
@@ -693,8 +695,10 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
request->SenseBuffer = scmnd->sense_buffer;
request->SenseBufferSize = SCSI_SENSE_BUFFERSIZE;
+ rmpb = &request->DataBuffer;
+ rmpba = rmpb->PfnArray;
- request->DataBuffer.Length = scsi_bufflen(scmnd);
+ rmpb->Length = scsi_bufflen(scmnd);
if (scsi_sg_count(scmnd)) {
sgl = (struct scatterlist *)scsi_sglist(scmnd);
@@ -733,20 +737,17 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
sgl = cmd_request->bounce_sgl;
}
- request->DataBuffer.Offset = sgl[0].offset;
+ rmpb->Offset = sgl[0].offset;
for (i = 0; i < scsi_sg_count(scmnd); i++) {
DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n",
i, sgl[i].length, sgl[i].offset);
- request->DataBuffer.PfnArray[i] =
- page_to_pfn(sg_page((&sgl[i])));
+ *rmpba++ = page_to_pfn(sg_page((&sgl[i])));
}
} else if (scsi_sglist(scmnd)) {
/* ASSERT(scsi_bufflen(scmnd) <= PAGE_SIZE); */
- request->DataBuffer.Offset =
- virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
- request->DataBuffer.PfnArray[0] =
- virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
+ rmpb->Offset = virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
+ *rmpba = virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
}
retry_request:
prev parent reply other threads:[~2010-09-01 22:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-31 18:13 [PATCH 2/5] staging: hv: Fixed lockup problem with bounce_buffer scatter list - RESEND Hank Janssen
2010-09-01 16:38 ` Joe Perches
2010-08-31 20:03 ` Hank Janssen
2010-09-01 22:45 ` Joe Perches [this message]
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=1283381128.1797.238.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=hjanssen@sailtheuniverse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).