aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
diff options
context:
space:
mode:
authorAriel Elior <ariele@broadcom.com>2011-11-12 23:34:31 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-13 16:03:56 -0500
commit72754080d14feef1ca0b3ae383ddfdc5d9a71b1a (patch)
tree05810c6843036c8ddf7ff5b5aae6a485b160e254 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
parent4a025f49d3f2f2f39b474af360c81a5587b41657 (diff)
bnx2x: Remove on-stack napi struct variable
Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e9a91a347c75..13dad9230dbc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -79,19 +79,21 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index)
79 * @to: destination FP index 79 * @to: destination FP index
80 * 80 *
81 * Makes sure the contents of the bp->fp[to].napi is kept 81 * Makes sure the contents of the bp->fp[to].napi is kept
82 * intact. 82 * intact. This is done by first copying the napi struct from
83 * the target to the source, and then mem copying the entire
84 * source onto the target
83 */ 85 */
84static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to) 86static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
85{ 87{
86 struct bnx2x_fastpath *from_fp = &bp->fp[from]; 88 struct bnx2x_fastpath *from_fp = &bp->fp[from];
87 struct bnx2x_fastpath *to_fp = &bp->fp[to]; 89 struct bnx2x_fastpath *to_fp = &bp->fp[to];
88 struct napi_struct orig_napi = to_fp->napi; 90
91 /* Copy the NAPI object as it has been already initialized */
92 from_fp->napi = to_fp->napi;
93
89 /* Move bnx2x_fastpath contents */ 94 /* Move bnx2x_fastpath contents */
90 memcpy(to_fp, from_fp, sizeof(*to_fp)); 95 memcpy(to_fp, from_fp, sizeof(*to_fp));
91 to_fp->index = to; 96 to_fp->index = to;
92
93 /* Restore the NAPI object as it has been already initialized */
94 to_fp->napi = orig_napi;
95} 97}
96 98
97int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */ 99int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */