Commit a225d2cd authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

net/smc: use smc_curs_copy() for SMC-D

SMC already provides a wrapper for atomic64 calls to be
architecture independent. Use this wrapper for SMC-D as well.
Reported-by: default avatarJens Remus <jremus@linux.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b03faa1f
...@@ -245,17 +245,18 @@ static inline void smcr_cdc_msg_to_host(struct smc_host_cdc_msg *local, ...@@ -245,17 +245,18 @@ static inline void smcr_cdc_msg_to_host(struct smc_host_cdc_msg *local,
} }
static inline void smcd_cdc_msg_to_host(struct smc_host_cdc_msg *local, static inline void smcd_cdc_msg_to_host(struct smc_host_cdc_msg *local,
struct smcd_cdc_msg *peer) struct smcd_cdc_msg *peer,
struct smc_connection *conn)
{ {
union smc_host_cursor temp; union smc_host_cursor temp;
temp.wrap = peer->prod.wrap; temp.wrap = peer->prod.wrap;
temp.count = peer->prod.count; temp.count = peer->prod.count;
atomic64_set(&local->prod.acurs, atomic64_read(&temp.acurs)); smc_curs_copy(&local->prod, &temp, conn);
temp.wrap = peer->cons.wrap; temp.wrap = peer->cons.wrap;
temp.count = peer->cons.count; temp.count = peer->cons.count;
atomic64_set(&local->cons.acurs, atomic64_read(&temp.acurs)); smc_curs_copy(&local->cons, &temp, conn);
local->prod_flags = peer->cons.prod_flags; local->prod_flags = peer->cons.prod_flags;
local->conn_state_flags = peer->cons.conn_state_flags; local->conn_state_flags = peer->cons.conn_state_flags;
} }
...@@ -265,7 +266,7 @@ static inline void smc_cdc_msg_to_host(struct smc_host_cdc_msg *local, ...@@ -265,7 +266,7 @@ static inline void smc_cdc_msg_to_host(struct smc_host_cdc_msg *local,
struct smc_connection *conn) struct smc_connection *conn)
{ {
if (conn->lgr->is_smcd) if (conn->lgr->is_smcd)
smcd_cdc_msg_to_host(local, (struct smcd_cdc_msg *)peer); smcd_cdc_msg_to_host(local, (struct smcd_cdc_msg *)peer, conn);
else else
smcr_cdc_msg_to_host(local, peer, conn); smcr_cdc_msg_to_host(local, peer, conn);
} }
......
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