Commit fc47ff6b authored by Robert Love's avatar Robert Love Committed by James Bottomley

[SCSI] libfc, fcoe: Remove unnecessary cast by removing inline wrapper

Comment from "Andrew Morton <akpm@linux-foundation.org>"

> +{
> +     return (struct fcoe_softc *)lport_priv(lp);

unneeded/undesirable cast of void*.  There are probably zillions of
instances of this - there always are.

This whole inline function was unnecessary. The FCoE layer knows
that it's data structure is stored in the lport private data, it
can just access it from lport_priv().
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent b2ab99c9
...@@ -297,7 +297,7 @@ static int fcoe_sw_destroy(struct net_device *netdev) ...@@ -297,7 +297,7 @@ static int fcoe_sw_destroy(struct net_device *netdev)
if (!lp) if (!lp)
return -ENODEV; return -ENODEV;
fc = fcoe_softc(lp); fc = lport_priv(lp);
/* Logout of the fabric */ /* Logout of the fabric */
fc_fabric_logoff(lp); fc_fabric_logoff(lp);
......
...@@ -387,7 +387,7 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp) ...@@ -387,7 +387,7 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
WARN_ON((fr_len(fp) % sizeof(u32)) != 0); WARN_ON((fr_len(fp) % sizeof(u32)) != 0);
fc = fcoe_softc(lp); fc = lport_priv(lp);
/* /*
* if it is a flogi then we need to learn gw-addr * if it is a flogi then we need to learn gw-addr
* and my own fcid * and my own fcid
...@@ -768,7 +768,7 @@ static int fcoe_check_wait_queue(struct fc_lport *lp) ...@@ -768,7 +768,7 @@ static int fcoe_check_wait_queue(struct fc_lport *lp)
struct sk_buff *skb; struct sk_buff *skb;
struct fcoe_softc *fc; struct fcoe_softc *fc;
fc = fcoe_softc(lp); fc = lport_priv(lp);
spin_lock_bh(&fc->fcoe_pending_queue.lock); spin_lock_bh(&fc->fcoe_pending_queue.lock);
/* /*
...@@ -805,7 +805,7 @@ static void fcoe_insert_wait_queue_head(struct fc_lport *lp, ...@@ -805,7 +805,7 @@ static void fcoe_insert_wait_queue_head(struct fc_lport *lp,
{ {
struct fcoe_softc *fc; struct fcoe_softc *fc;
fc = fcoe_softc(lp); fc = lport_priv(lp);
spin_lock_bh(&fc->fcoe_pending_queue.lock); spin_lock_bh(&fc->fcoe_pending_queue.lock);
__skb_queue_head(&fc->fcoe_pending_queue, skb); __skb_queue_head(&fc->fcoe_pending_queue, skb);
spin_unlock_bh(&fc->fcoe_pending_queue.lock); spin_unlock_bh(&fc->fcoe_pending_queue.lock);
...@@ -823,7 +823,7 @@ static void fcoe_insert_wait_queue(struct fc_lport *lp, ...@@ -823,7 +823,7 @@ static void fcoe_insert_wait_queue(struct fc_lport *lp,
{ {
struct fcoe_softc *fc; struct fcoe_softc *fc;
fc = fcoe_softc(lp); fc = lport_priv(lp);
spin_lock_bh(&fc->fcoe_pending_queue.lock); spin_lock_bh(&fc->fcoe_pending_queue.lock);
__skb_queue_tail(&fc->fcoe_pending_queue, skb); __skb_queue_tail(&fc->fcoe_pending_queue, skb);
spin_unlock_bh(&fc->fcoe_pending_queue.lock); spin_unlock_bh(&fc->fcoe_pending_queue.lock);
...@@ -1113,7 +1113,7 @@ MODULE_PARM_DESC(destroy, "Destroy fcoe port"); ...@@ -1113,7 +1113,7 @@ MODULE_PARM_DESC(destroy, "Destroy fcoe port");
*/ */
int fcoe_link_ok(struct fc_lport *lp) int fcoe_link_ok(struct fc_lport *lp)
{ {
struct fcoe_softc *fc = fcoe_softc(lp); struct fcoe_softc *fc = lport_priv(lp);
struct net_device *dev = fc->real_dev; struct net_device *dev = fc->real_dev;
struct ethtool_cmd ecmd = { ETHTOOL_GSET }; struct ethtool_cmd ecmd = { ETHTOOL_GSET };
int rc = 0; int rc = 0;
...@@ -1329,7 +1329,7 @@ int fcoe_hostlist_add(const struct fc_lport *lp) ...@@ -1329,7 +1329,7 @@ int fcoe_hostlist_add(const struct fc_lport *lp)
fc = fcoe_hostlist_lookup_softc(fcoe_netdev(lp)); fc = fcoe_hostlist_lookup_softc(fcoe_netdev(lp));
if (!fc) { if (!fc) {
fc = fcoe_softc(lp); fc = lport_priv(lp);
write_lock_bh(&fcoe_hostlist_lock); write_lock_bh(&fcoe_hostlist_lock);
list_add_tail(&fc->list, &fcoe_hostlist); list_add_tail(&fc->list, &fcoe_hostlist);
write_unlock_bh(&fcoe_hostlist_lock); write_unlock_bh(&fcoe_hostlist_lock);
......
...@@ -58,16 +58,10 @@ struct fcoe_softc { ...@@ -58,16 +58,10 @@ struct fcoe_softc {
u8 address_mode; u8 address_mode;
}; };
static inline struct fcoe_softc *fcoe_softc(
const struct fc_lport *lp)
{
return (struct fcoe_softc *)lport_priv(lp);
}
static inline struct net_device *fcoe_netdev( static inline struct net_device *fcoe_netdev(
const struct fc_lport *lp) const struct fc_lport *lp)
{ {
return fcoe_softc(lp)->real_dev; return ((struct fcoe_softc *)lport_priv(lp))->real_dev;
} }
static inline struct fcoe_hdr *skb_fcoe_header(const struct sk_buff *skb) static inline struct fcoe_hdr *skb_fcoe_header(const struct sk_buff *skb)
......
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