X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fipr.c;h=ded854a6dd35bd0d916f630090fc87990cd59182;hb=3a2c5dad6c4d4551effba477f4f45fa5feb1293f;hp=d30eb7ba018e6dde266ac53253b95c8687dde8e8;hpb=0da939b0058742ad2d8580b7db6b966d0fc72252;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index d30eb7ba018..ded854a6dd3 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -2456,20 +2456,14 @@ static ssize_t ipr_read_trace(struct kobject *kobj, 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 = { @@ -7859,7 +7853,6 @@ static struct pci_driver ipr_driver = { .remove = ipr_remove, .shutdown = ipr_shutdown, .err_handler = &ipr_err_handler, - .dynids.use_driver_data = 1 }; /**