diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2017-10-06 14:59:05 -0400 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2017-10-09 05:20:02 -0400 |
commit | 430594c1c7f5051f0d99ed9d08d086d20587cdd1 (patch) | |
tree | c13dcc1666c941644cfe3937a6696a39db6129a2 | |
parent | 48bee74a354b211c4e4cb62e6a7b7986749747cf (diff) |
firmware: arm_scpi: silence sparse warnings
At several positions in the code sparse complains about incorrect access
to __iomem annotated memory. Fix this and make sparse happy.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r-- | drivers/firmware/arm_scpi.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index f0c37a4ecddf..dfb373c8ba2a 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c | |||
@@ -405,19 +405,20 @@ static void scpi_process_cmd(struct scpi_chan *ch, u32 cmd) | |||
405 | unsigned int len; | 405 | unsigned int len; |
406 | 406 | ||
407 | if (scpi_info->is_legacy) { | 407 | if (scpi_info->is_legacy) { |
408 | struct legacy_scpi_shared_mem *mem = ch->rx_payload; | 408 | struct legacy_scpi_shared_mem __iomem *mem = |
409 | ch->rx_payload; | ||
409 | 410 | ||
410 | /* RX Length is not replied by the legacy Firmware */ | 411 | /* RX Length is not replied by the legacy Firmware */ |
411 | len = match->rx_len; | 412 | len = match->rx_len; |
412 | 413 | ||
413 | match->status = le32_to_cpu(mem->status); | 414 | match->status = ioread32(&mem->status); |
414 | memcpy_fromio(match->rx_buf, mem->payload, len); | 415 | memcpy_fromio(match->rx_buf, mem->payload, len); |
415 | } else { | 416 | } else { |
416 | struct scpi_shared_mem *mem = ch->rx_payload; | 417 | struct scpi_shared_mem __iomem *mem = ch->rx_payload; |
417 | 418 | ||
418 | len = min(match->rx_len, CMD_SIZE(cmd)); | 419 | len = min(match->rx_len, CMD_SIZE(cmd)); |
419 | 420 | ||
420 | match->status = le32_to_cpu(mem->status); | 421 | match->status = ioread32(&mem->status); |
421 | memcpy_fromio(match->rx_buf, mem->payload, len); | 422 | memcpy_fromio(match->rx_buf, mem->payload, len); |
422 | } | 423 | } |
423 | 424 | ||
@@ -431,11 +432,11 @@ static void scpi_process_cmd(struct scpi_chan *ch, u32 cmd) | |||
431 | static void scpi_handle_remote_msg(struct mbox_client *c, void *msg) | 432 | static void scpi_handle_remote_msg(struct mbox_client *c, void *msg) |
432 | { | 433 | { |
433 | struct scpi_chan *ch = container_of(c, struct scpi_chan, cl); | 434 | struct scpi_chan *ch = container_of(c, struct scpi_chan, cl); |
434 | struct scpi_shared_mem *mem = ch->rx_payload; | 435 | struct scpi_shared_mem __iomem *mem = ch->rx_payload; |
435 | u32 cmd = 0; | 436 | u32 cmd = 0; |
436 | 437 | ||
437 | if (!scpi_info->is_legacy) | 438 | if (!scpi_info->is_legacy) |
438 | cmd = le32_to_cpu(mem->command); | 439 | cmd = ioread32(&mem->command); |
439 | 440 | ||
440 | scpi_process_cmd(ch, cmd); | 441 | scpi_process_cmd(ch, cmd); |
441 | } | 442 | } |
@@ -445,7 +446,7 @@ static void scpi_tx_prepare(struct mbox_client *c, void *msg) | |||
445 | unsigned long flags; | 446 | unsigned long flags; |
446 | struct scpi_xfer *t = msg; | 447 | struct scpi_xfer *t = msg; |
447 | struct scpi_chan *ch = container_of(c, struct scpi_chan, cl); | 448 | struct scpi_chan *ch = container_of(c, struct scpi_chan, cl); |
448 | struct scpi_shared_mem *mem = ch->tx_payload; | 449 | struct scpi_shared_mem __iomem *mem = ch->tx_payload; |
449 | 450 | ||
450 | if (t->tx_buf) { | 451 | if (t->tx_buf) { |
451 | if (scpi_info->is_legacy) | 452 | if (scpi_info->is_legacy) |
@@ -464,7 +465,7 @@ static void scpi_tx_prepare(struct mbox_client *c, void *msg) | |||
464 | } | 465 | } |
465 | 466 | ||
466 | if (!scpi_info->is_legacy) | 467 | if (!scpi_info->is_legacy) |
467 | mem->command = cpu_to_le32(t->cmd); | 468 | iowrite32(t->cmd, &mem->command); |
468 | } | 469 | } |
469 | 470 | ||
470 | static struct scpi_xfer *get_scpi_xfer(struct scpi_chan *ch) | 471 | static struct scpi_xfer *get_scpi_xfer(struct scpi_chan *ch) |