ipr: use memory_read_from_buffer()
Subsystems (2)
PATCH 9/17 ipr: use memory_read_from_buffer()
From: Akinobu Mita <[email protected]>
Signed-off-by Akinobu Mita <[email protected]>
Cc Brian King <[email protected]>
Cc James E.J. Bottomley <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/ipr.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
drivers/scsi/ipr.c renamed from drivers/scsi/ipr.c~ipr-use-memory_read_from_buffer +5 -11
@@ -2456,20 +2456,14 @@ static ssize_t ipr_read_trace(struct kobstruct 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 = {
_
James Bottomley
maintainerQuoted 6 lines · On Mon, 2008-09-22 at 14:56 -0700, [email protected] wrote:
From: Akinobu Mita <[email protected]>
Signed-off-by Akinobu Mita <[email protected]>Cc Brian King <[email protected]>Cc James E.J. Bottomley <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Brian,
Can I get an ack for this (or can you merge it into your patch set)?
Thanks,
James
Acked by: Brian King <[email protected]>
Quoted 45 lines · [email protected] wrote:
From: Akinobu Mita <[email protected]>
Signed-off-by Akinobu Mita <[email protected]>Cc Brian King <[email protected]>Cc James E.J. Bottomley <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/scsi/ipr.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)diff -puN
drivers/scsi/ipr.c~ipr-use-memory_read_from_bufferdrivers/scsi/ipr.cdrivers/scsi/ipr.c renamed from drivers/scsi/ipr.c~ipr-use-memory_read_from_buffer +5
-11@@ -2456,20 +2456,14 @@ static ssize_t ipr_read_trace(struct kobstruct 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Brian King Linux on Power Virtualization IBM Linux Technology Center