From: Brian King <brking@linux.vnet.ibm.com>
To: akpm@linux-foundation.org
Cc: James.Bottomley@HansenPartnership.com,
linux-scsi@vger.kernel.org, akinobu.mita@gmail.com,
brking@us.ibm.com
Subject: Re: [patch 09/17] ipr: use memory_read_from_buffer()
Date: Tue, 07 Oct 2008 13:50:07 -0500 [thread overview]
Message-ID: <48EBAF5F.2000805@linux.vnet.ibm.com> (raw)
In-Reply-To: <200809222156.m8MLulrK032288@imap1.linux-foundation.org>
Acked by: Brian King <brking@linux.vnet.ibm.com>
akpm@linux-foundation.org wrote:
> From: Akinobu Mita <akinobu.mita@gmail.com>
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Brian King <brking@us.ibm.com>
> Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/scsi/ipr.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff -puN drivers/scsi/ipr.c~ipr-use-memory_read_from_buffer drivers/scsi/ipr.c
> --- a/drivers/scsi/ipr.c~ipr-use-memory_read_from_buffer
> +++ a/drivers/scsi/ipr.c
> @@ -2456,20 +2456,14 @@ static ssize_t ipr_read_trace(struct kob
> struct Scsi_Host *shost = class_to_shost(dev);
> struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
> unsigned long lock_flags = 0;
> - int size = IPR_TRACE_SIZE;
> - char *src = (char *)ioa_cfg->trace;
> -
> - if (off > size)
> - return 0;
> - if (off + count > size) {
> - size -= off;
> - count = size;
> - }
> + ssize_t ret;
>
> spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
> - memcpy(buf, &src[off], count);
> + ret = memory_read_from_buffer(buf, count, &off, ioa_cfg->trace,
> + IPR_TRACE_SIZE);
> spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
> - return count;
> +
> + return ret;
> }
>
> static struct bin_attribute ipr_trace_attr = {
> _
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
prev parent reply other threads:[~2008-10-07 18:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-22 21:56 [patch 09/17] ipr: use memory_read_from_buffer() akpm
2008-09-29 22:24 ` James Bottomley
2008-10-07 18:50 ` Brian King [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=48EBAF5F.2000805@linux.vnet.ibm.com \
--to=brking@linux.vnet.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brking@us.ibm.com \
--cc=linux-scsi@vger.kernel.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