From: Ariel Elior Date: Sun, 13 Nov 2011 04:34:31 +0000 (+0000) Subject: bnx2x: Remove on-stack napi struct variable X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~545 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=87d4e033332c6f75adfb2fb5e094a3ba4304c69f;p=users%2Fjedix%2Flinux-maple.git bnx2x: Remove on-stack napi struct variable (cherry picked from commit 72754080d14feef1ca0b3ae383ddfdc5d9a71b1a) Signed-off-by: Ariel Elior Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller Signed-off-by: Joe Jin --- diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index b625dd29d0266..fc994ba8c33b2 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -77,19 +77,21 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index) * @to: destination FP index * * 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) { struct bnx2x_fastpath *from_fp = &bp->fp[from]; 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 */ memcpy(to_fp, from_fp, sizeof(*to_fp)); 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 */