diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 16:02:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 16:02:03 -0400 |
commit | f8aea20018aefa51bf818914c9c1ef9006353dbb (patch) | |
tree | 36c5ab25fc6808ae635ae69e3f301b11ef52d72f /drivers/scsi/ipr.c | |
parent | c3c9897c63ebb0b93b7f78724e38d6ee1da04041 (diff) | |
parent | 520a2c2741747062e75f91cd0faddb564fbc64d2 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (21 commits)
[SCSI] sd: fix computation of the full size of the device
[SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact
[SCSI] sun3x_esp: Convert && to ||
[SCSI] sd: remove command-size switching code
[SCSI] 3w-9xxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[SCSI] 3w-xxxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[SCSI] fix netlink kernel-doc
[SCSI] sd: Fix handling of NO_SENSE check condition
[SCSI] export busy state via q->lld_busy_fn()
[SCSI] refactor sdev/starget/shost busy checking
[SCSI] mptfusion: Increase scsi-timeouts, similariy to the LSI 4.x driver.
[SCSI] aic7xxx: Take the LED out of diagnostic mode on PM resume
[SCSI] aic79xx: user visible misuse wrong SI units (not disk size!)
[SCSI] ipr: use memory_read_from_buffer()
[SCSI] aic79xx: fix shadowed variables
[SCSI] aic79xx: fix shadowed variables, add statics
[SCSI] aic7xxx: update *_shipped files
[SCSI] aic7xxx: update .reg files
[SCSI] aic7xxx: introduce "dont_generate_debug_code" keyword in aicasm parser
[SCSI] scsi_dh: Initialize path state to be passive when path is not owned
...
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 098739deb02e..ded854a6dd35 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -2456,20 +2456,14 @@ static ssize_t ipr_read_trace(struct kobject *kobj, | |||
2456 | struct Scsi_Host *shost = class_to_shost(dev); | 2456 | struct Scsi_Host *shost = class_to_shost(dev); |
2457 | struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata; | 2457 | struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata; |
2458 | unsigned long lock_flags = 0; | 2458 | unsigned long lock_flags = 0; |
2459 | int size = IPR_TRACE_SIZE; | 2459 | ssize_t ret; |
2460 | char *src = (char *)ioa_cfg->trace; | ||
2461 | |||
2462 | if (off > size) | ||
2463 | return 0; | ||
2464 | if (off + count > size) { | ||
2465 | size -= off; | ||
2466 | count = size; | ||
2467 | } | ||
2468 | 2460 | ||
2469 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); | 2461 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); |
2470 | memcpy(buf, &src[off], count); | 2462 | ret = memory_read_from_buffer(buf, count, &off, ioa_cfg->trace, |
2463 | IPR_TRACE_SIZE); | ||
2471 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 2464 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
2472 | return count; | 2465 | |
2466 | return ret; | ||
2473 | } | 2467 | } |
2474 | 2468 | ||
2475 | static struct bin_attribute ipr_trace_attr = { | 2469 | static struct bin_attribute ipr_trace_attr = { |