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>
This commit is contained in:
parent
ed72a4d52a
commit
37419d674c
1 changed files with 4 additions and 3 deletions
|
@ -704,16 +704,17 @@ static void session_maintenance_work(struct work_struct *work)
|
||||||
static int tgt_agent_rw_agent_state(struct fw_card *card, int tcode, void *data,
|
static int tgt_agent_rw_agent_state(struct fw_card *card, int tcode, void *data,
|
||||||
struct sbp_target_agent *agent)
|
struct sbp_target_agent *agent)
|
||||||
{
|
{
|
||||||
__be32 state;
|
int state;
|
||||||
|
|
||||||
switch (tcode) {
|
switch (tcode) {
|
||||||
case TCODE_READ_QUADLET_REQUEST:
|
case TCODE_READ_QUADLET_REQUEST:
|
||||||
pr_debug("tgt_agent AGENT_STATE READ\n");
|
pr_debug("tgt_agent AGENT_STATE READ\n");
|
||||||
|
|
||||||
spin_lock_bh(&agent->lock);
|
spin_lock_bh(&agent->lock);
|
||||||
state = cpu_to_be32(agent->state);
|
state = agent->state;
|
||||||
spin_unlock_bh(&agent->lock);
|
spin_unlock_bh(&agent->lock);
|
||||||
memcpy(data, &state, sizeof(state));
|
|
||||||
|
*(__be32 *)data = cpu_to_be32(state);
|
||||||
|
|
||||||
return RCODE_COMPLETE;
|
return RCODE_COMPLETE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue