diff options
author | Chris Boot <bootc@bootc.net> | 2012-12-11 16:58:47 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-12-13 00:16:47 -0500 |
commit | 37419d674ca99739dbee5ada28b50aacc29c94e1 (patch) | |
tree | 727a2b2faf812f9d8d3c36398a88f213f3248ed4 /drivers/target | |
parent | ed72a4d52add345595f09b360d6ac5f20428d361 (diff) |
sbp-target: use simple assignment in tgt_agent_rw_agent_state()
There is no need to memcpy() a 32-bit integer. The data pointer is
guaranteed to be quadlet aligned by the FireWire stack so we can replace
the memcpy() with an assignment.
Thanks to Stefan Richter.
Signed-off-by: Chris Boot <bootc@bootc.net>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/sbp/sbp_target.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 0d6d7c1f025e..f0a2a1d982a2 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c | |||
@@ -704,16 +704,17 @@ static void session_maintenance_work(struct work_struct *work) | |||
704 | static int tgt_agent_rw_agent_state(struct fw_card *card, int tcode, void *data, | 704 | static int tgt_agent_rw_agent_state(struct fw_card *card, int tcode, void *data, |
705 | struct sbp_target_agent *agent) | 705 | struct sbp_target_agent *agent) |
706 | { | 706 | { |
707 | __be32 state; | 707 | int state; |
708 | 708 | ||
709 | switch (tcode) { | 709 | switch (tcode) { |
710 | case TCODE_READ_QUADLET_REQUEST: | 710 | case TCODE_READ_QUADLET_REQUEST: |
711 | pr_debug("tgt_agent AGENT_STATE READ\n"); | 711 | pr_debug("tgt_agent AGENT_STATE READ\n"); |
712 | 712 | ||
713 | spin_lock_bh(&agent->lock); | 713 | spin_lock_bh(&agent->lock); |
714 | state = cpu_to_be32(agent->state); | 714 | state = agent->state; |
715 | spin_unlock_bh(&agent->lock); | 715 | spin_unlock_bh(&agent->lock); |
716 | memcpy(data, &state, sizeof(state)); | 716 | |
717 | *(__be32 *)data = cpu_to_be32(state); | ||
717 | 718 | ||
718 | return RCODE_COMPLETE; | 719 | return RCODE_COMPLETE; |
719 | 720 | ||