Commit d8ea1542 authored by Markus Lidel's avatar Markus Lidel Committed by Linus Torvalds

[PATCH] i2o: message conversion fix for le32_to_cpu parameters

- fixed incorrect parameters to le32_to_cpu which was introduced with the
  I2O message conversion patch
Signed-off-by: default avatarMarkus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent dcc7a924
...@@ -323,11 +323,11 @@ static void i2o_exec_lct_modified(struct i2o_controller *c) ...@@ -323,11 +323,11 @@ static void i2o_exec_lct_modified(struct i2o_controller *c)
static int i2o_exec_reply(struct i2o_controller *c, u32 m, static int i2o_exec_reply(struct i2o_controller *c, u32 m,
struct i2o_message *msg) struct i2o_message *msg)
{ {
if (le32_to_cpu(&msg->u.head[0]) & MSG_FAIL) { // Fail bit is set if (le32_to_cpu(msg->u.head[0]) & MSG_FAIL) { // Fail bit is set
struct i2o_message *pmsg; /* preserved message */ struct i2o_message *pmsg; /* preserved message */
u32 pm; u32 pm;
pm = le32_to_cpu(&msg->body[3]); pm = le32_to_cpu(msg->body[3]);
pmsg = i2o_msg_in_to_virt(c, pm); pmsg = i2o_msg_in_to_virt(c, pm);
...@@ -340,10 +340,10 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, ...@@ -340,10 +340,10 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m,
return -1; return -1;
} }
if (le32_to_cpu(&msg->u.s.tcntxt) & 0x80000000) if (le32_to_cpu(msg->u.s.tcntxt) & 0x80000000)
return i2o_msg_post_wait_complete(c, m, msg); return i2o_msg_post_wait_complete(c, m, msg);
if ((le32_to_cpu(&msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) { if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) {
struct work_struct *work; struct work_struct *work;
pr_debug("%s: LCT notify received\n", c->name); pr_debug("%s: LCT notify received\n", c->name);
......
...@@ -416,7 +416,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -416,7 +416,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
unsigned long flags; unsigned long flags;
/* FAILed message */ /* FAILed message */
if (unlikely(le32_to_cpu(&msg->u.head[0]) & (1 << 13))) { if (unlikely(le32_to_cpu(msg->u.head[0]) & (1 << 13))) {
struct i2o_message *pmsg; struct i2o_message *pmsg;
u32 pm; u32 pm;
...@@ -430,10 +430,10 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -430,10 +430,10 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
* better be on the safe side since no one really follows * better be on the safe side since no one really follows
* the spec to the book :) * the spec to the book :)
*/ */
pm = le32_to_cpu(&msg->body[3]); pm = le32_to_cpu(msg->body[3]);
pmsg = i2o_msg_in_to_virt(c, pm); pmsg = i2o_msg_in_to_virt(c, pm);
req = i2o_cntxt_list_get(c, le32_to_cpu(&pmsg->u.s.tcntxt)); req = i2o_cntxt_list_get(c, le32_to_cpu(pmsg->u.s.tcntxt));
if (unlikely(!req)) { if (unlikely(!req)) {
printk(KERN_ERR "block-osm: NULL reply received!\n"); printk(KERN_ERR "block-osm: NULL reply received!\n");
return -1; return -1;
...@@ -448,7 +448,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -448,7 +448,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
while (end_that_request_chunk(req, !req->errors, while (end_that_request_chunk(req, !req->errors,
le32_to_cpu(&pmsg->body[1]))) ; le32_to_cpu(pmsg->body[1]))) ;
end_that_request_last(req); end_that_request_last(req);
dev->open_queue_depth--; dev->open_queue_depth--;
...@@ -463,7 +463,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -463,7 +463,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
return -1; return -1;
} }
req = i2o_cntxt_list_get(c, le32_to_cpu(&msg->u.s.tcntxt)); req = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt));
if (unlikely(!req)) { if (unlikely(!req)) {
printk(KERN_ERR "block-osm: NULL reply received!\n"); printk(KERN_ERR "block-osm: NULL reply received!\n");
return -1; return -1;
...@@ -486,7 +486,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -486,7 +486,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
"I2O Block: Data transfer to deleted device!\n"); "I2O Block: Data transfer to deleted device!\n");
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
while (end_that_request_chunk while (end_that_request_chunk
(req, !req->errors, le32_to_cpu(&msg->body[1]))) ; (req, !req->errors, le32_to_cpu(msg->body[1]))) ;
end_that_request_last(req); end_that_request_last(req);
dev->open_queue_depth--; dev->open_queue_depth--;
...@@ -502,7 +502,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -502,7 +502,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
* request in the context. * request in the context.
*/ */
st = le32_to_cpu(&msg->body[0]) >> 24; st = le32_to_cpu(msg->body[0]) >> 24;
if (st != 0) { if (st != 0) {
int err; int err;
...@@ -523,7 +523,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -523,7 +523,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
"Volume has changed, waiting for acknowledgement" "Volume has changed, waiting for acknowledgement"
}; };
err = le32_to_cpu(&msg->body[0]) & 0xffff; err = le32_to_cpu(msg->body[0]) & 0xffff;
/* /*
* Device not ready means two things. One is that the * Device not ready means two things. One is that the
...@@ -538,17 +538,17 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m, ...@@ -538,17 +538,17 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
*/ */
printk(KERN_ERR "/dev/%s error: %s", dev->gd->disk_name, printk(KERN_ERR "/dev/%s error: %s", dev->gd->disk_name,
bsa_errors[le32_to_cpu(&msg->body[0]) & 0xffff]); bsa_errors[le32_to_cpu(msg->body[0]) & 0xffff]);
if (le32_to_cpu(&msg->body[0]) & 0x00ff0000) if (le32_to_cpu(msg->body[0]) & 0x00ff0000)
printk(KERN_ERR " - DDM attempted %d retries", printk(KERN_ERR " - DDM attempted %d retries",
(le32_to_cpu(&msg->body[0]) >> 16) & 0x00ff); (le32_to_cpu(msg->body[0]) >> 16) & 0x00ff);
printk(KERN_ERR ".\n"); printk(KERN_ERR ".\n");
req->errors++; req->errors++;
} else } else
req->errors = 0; req->errors = 0;
if (!end_that_request_chunk if (!end_that_request_chunk
(req, !req->errors, le32_to_cpu(&msg->body[1]))) { (req, !req->errors, le32_to_cpu(msg->body[1]))) {
add_disk_randomness(req->rq_disk); add_disk_randomness(req->rq_disk);
spin_lock_irqsave(q->queue_lock, flags); spin_lock_irqsave(q->queue_lock, flags);
......
...@@ -296,14 +296,14 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, ...@@ -296,14 +296,14 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
struct device *dev; struct device *dev;
u8 as, ds, st; u8 as, ds, st;
cmd = i2o_cntxt_list_get(c, le32_to_cpu(&msg->u.s.tcntxt)); cmd = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt));
if (msg->u.head[0] & (1 << 13)) { if (msg->u.head[0] & (1 << 13)) {
struct i2o_message *pmsg; /* preserved message */ struct i2o_message *pmsg; /* preserved message */
u32 pm; u32 pm;
int err = DID_ERROR; int err = DID_ERROR;
pm = le32_to_cpu(&msg->body[3]); pm = le32_to_cpu(msg->body[3]);
pmsg = i2o_msg_in_to_virt(c, pm); pmsg = i2o_msg_in_to_virt(c, pm);
...@@ -343,9 +343,9 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, ...@@ -343,9 +343,9 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
* Low byte is device status, next is adapter status, * Low byte is device status, next is adapter status,
* (then one byte reserved), then request status. * (then one byte reserved), then request status.
*/ */
ds = (u8) le32_to_cpu(&msg->body[0]); ds = (u8) le32_to_cpu(msg->body[0]);
as = (u8) (le32_to_cpu(&msg->body[0]) >> 8); as = (u8) (le32_to_cpu(msg->body[0]) >> 8);
st = (u8) (le32_to_cpu(&msg->body[0]) >> 24); st = (u8) (le32_to_cpu(msg->body[0]) >> 24);
/* /*
* Is this a control request coming back - eg an abort ? * Is this a control request coming back - eg an abort ?
...@@ -354,7 +354,7 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, ...@@ -354,7 +354,7 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
if (!cmd) { if (!cmd) {
if (st) if (st)
printk(KERN_WARNING "SCSI abort: %08X", printk(KERN_WARNING "SCSI abort: %08X",
le32_to_cpu(&msg->body[0])); le32_to_cpu(msg->body[0]));
printk(KERN_INFO "SCSI abort completed.\n"); printk(KERN_INFO "SCSI abort completed.\n");
return -EFAULT; return -EFAULT;
} }
...@@ -367,7 +367,7 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, ...@@ -367,7 +367,7 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
switch (st) { switch (st) {
case 0x06: case 0x06:
count = le32_to_cpu(&msg->body[1]); count = le32_to_cpu(msg->body[1]);
if (count < cmd->underflow) { if (count < cmd->underflow) {
int i; int i;
printk(KERN_ERR "SCSI: underflow 0x%08X 0x%08X" printk(KERN_ERR "SCSI: underflow 0x%08X 0x%08X"
...@@ -382,7 +382,7 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, ...@@ -382,7 +382,7 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
break; break;
default: default:
error = le32_to_cpu(&msg->body[0]); error = le32_to_cpu(msg->body[0]);
printk(KERN_ERR "scsi-osm: SCSI error %08x\n", error); printk(KERN_ERR "scsi-osm: SCSI error %08x\n", error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment