Skip to content

Commit 7275408

Browse files
Ariel Eliordavem330
authored andcommitted
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>
1 parent 4a025f4 commit 7275408

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,21 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index)
7979
* @to: destination FP index
8080
*
8181
* 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
8385
*/
8486
static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
8587
{
8688
struct bnx2x_fastpath *from_fp = &bp->fp[from];
8789
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+
8994
/* Move bnx2x_fastpath contents */
9095
memcpy(to_fp, from_fp, sizeof(*to_fp));
9196
to_fp->index = to;
92-
93-
/* Restore the NAPI object as it has been already initialized */
94-
to_fp->napi = orig_napi;
9597
}
9698

9799
int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 */

0 commit comments

Comments
 (0)