netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr
@ 2024-03-28  2:07 Su Hui
  2024-03-29 17:45 ` Simon Horman
  2024-03-29 19:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Su Hui @ 2024-03-28  2:07 UTC (permalink / raw)
  To: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	nathan, ndesaulniers, morbo, justinstitt
  Cc: Su Hui, dan.carpenter, netdev, linux-kernel, llvm,
	kernel-janitors

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>
---
v3:
 - using net-next in subject
 - split the v2 patchset into individual patches
v2:
 - add "net" in subject

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 3f46d5e0fb2e..637b05c79c42 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -450,7 +450,6 @@ static void otx2_pfvf_mbox_handler(struct work_struct *work)
 	struct mbox_msghdr *msg = NULL;
 	int offset, vf_idx, id, err;
 	struct otx2_mbox_dev *mdev;
-	struct mbox_hdr *req_hdr;
 	struct otx2_mbox *mbox;
 	struct mbox *vf_mbox;
 	struct otx2_nic *pf;
@@ -461,9 +460,8 @@ static void otx2_pfvf_mbox_handler(struct work_struct *work)
 
 	mbox = &pf->mbox_pfvf[0].mbox;
 	mdev = &mbox->dev[vf_idx];
-	req_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
 
-	offset = ALIGN(sizeof(*req_hdr), MBOX_MSG_ALIGN);
+	offset = ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);
 
 	for (id = 0; id < vf_mbox->num_msgs; id++) {
 		msg = (struct mbox_msghdr *)(mdev->mbase + mbox->rx_start +
@@ -494,7 +492,6 @@ static void otx2_pfvf_mbox_up_handler(struct work_struct *work)
 	struct otx2_nic *pf = vf_mbox->pfvf;
 	struct otx2_mbox_dev *mdev;
 	int offset, id, vf_idx = 0;
-	struct mbox_hdr *rsp_hdr;
 	struct mbox_msghdr *msg;
 	struct otx2_mbox *mbox;
 
@@ -502,8 +499,7 @@ static void otx2_pfvf_mbox_up_handler(struct work_struct *work)
 	mbox = &pf->mbox_pfvf[0].mbox_up;
 	mdev = &mbox->dev[vf_idx];
 
-	rsp_hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
-	offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
+	offset = mbox->rx_start + ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);
 
 	for (id = 0; id < vf_mbox->up_num_msgs; id++) {
 		msg = mdev->mbase + offset;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr
  2024-03-28  2:07 [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
@ 2024-03-29 17:45 ` Simon Horman
  2024-03-29 19:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-03-29 17:45 UTC (permalink / raw)
  To: Su Hui
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	nathan, ndesaulniers, morbo, justinstitt, dan.carpenter, netdev,
	linux-kernel, llvm, kernel-janitors

On Thu, Mar 28, 2024 at 10:07:24AM +0800, Su Hui wrote:
> 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>
> ---
> v3:
>  - using net-next in subject
>  - split the v2 patchset into individual patches
> v2:
>  - add "net" in subject

Thanks for the updates.

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr
  2024-03-28  2:07 [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
  2024-03-29 17:45 ` Simon Horman
@ 2024-03-29 19:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-29 19:50 UTC (permalink / raw)
  To: Su Hui
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	nathan, ndesaulniers, morbo, justinstitt, dan.carpenter, netdev,
	linux-kernel, llvm, kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 28 Mar 2024 10:07:24 +0800 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next,v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr
    https://git.kernel.org/netdev/net-next/c/1ab6fe64d220

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-29 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-28  2:07 [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
2024-03-29 17:45 ` Simon Horman
2024-03-29 19:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).