Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

octeontx2-pf: remove unused variables req_hdr and rsp_hdr

Clang static checker(scan-buid):
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:503:2: warning:
Value stored to 'rsp_hdr' is never read [deadcode.DeadStores]

Remove these unused variables to save some space.

Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240328020723.4071539-1-suhui@nfschina.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Su Hui and committed by
Jakub Kicinski
1ab6fe64 e93af722

+2 -6
+2 -6
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
··· 450 450 struct mbox_msghdr *msg = NULL; 451 451 int offset, vf_idx, id, err; 452 452 struct otx2_mbox_dev *mdev; 453 - struct mbox_hdr *req_hdr; 454 453 struct otx2_mbox *mbox; 455 454 struct mbox *vf_mbox; 456 455 struct otx2_nic *pf; ··· 460 461 461 462 mbox = &pf->mbox_pfvf[0].mbox; 462 463 mdev = &mbox->dev[vf_idx]; 463 - req_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start); 464 464 465 - offset = ALIGN(sizeof(*req_hdr), MBOX_MSG_ALIGN); 465 + offset = ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN); 466 466 467 467 for (id = 0; id < vf_mbox->num_msgs; id++) { 468 468 msg = (struct mbox_msghdr *)(mdev->mbase + mbox->rx_start + ··· 492 494 struct otx2_nic *pf = vf_mbox->pfvf; 493 495 struct otx2_mbox_dev *mdev; 494 496 int offset, id, vf_idx = 0; 495 - struct mbox_hdr *rsp_hdr; 496 497 struct mbox_msghdr *msg; 497 498 struct otx2_mbox *mbox; 498 499 ··· 499 502 mbox = &pf->mbox_pfvf[0].mbox_up; 500 503 mdev = &mbox->dev[vf_idx]; 501 504 502 - rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start); 503 - offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN); 505 + offset = mbox->rx_start + ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN); 504 506 505 507 for (id = 0; id < vf_mbox->up_num_msgs; id++) { 506 508 msg = mdev->mbase + offset;