Commit 72754080 authored by Ariel Elior's avatar Ariel Elior Committed by David S. Miller

bnx2x: Remove on-stack napi struct variable

Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a025f49
...@@ -79,19 +79,21 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index) ...@@ -79,19 +79,21 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index)
* @to: destination FP index * @to: destination FP index
* *
* Makes sure the contents of the bp->fp[to].napi is kept * Makes sure the contents of the bp->fp[to].napi is kept
* intact. * intact. This is done by first copying the napi struct from
* the target to the source, and then mem copying the entire
* source onto the target
*/ */
static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to) static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
{ {
struct bnx2x_fastpath *from_fp = &bp->fp[from]; struct bnx2x_fastpath *from_fp = &bp->fp[from];
struct bnx2x_fastpath *to_fp = &bp->fp[to]; struct bnx2x_fastpath *to_fp = &bp->fp[to];
struct napi_struct orig_napi = to_fp->napi;
/* Copy the NAPI object as it has been already initialized */
from_fp->napi = to_fp->napi;
/* Move bnx2x_fastpath contents */ /* Move bnx2x_fastpath contents */
memcpy(to_fp, from_fp, sizeof(*to_fp)); memcpy(to_fp, from_fp, sizeof(*to_fp));
to_fp->index = to; to_fp->index = to;
/* Restore the NAPI object as it has been already initialized */
to_fp->napi = orig_napi;
} }
int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */ int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */
......
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