diff mbox series

[2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr

Message ID 20240325073549.823832-2-suhui@nfschina.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [1/2] octeontx2-pf: check negative error code in otx2_open() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 13 of 13 maintainers
netdev/build_clang success Errors and warnings before: 955 this patch: 955
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 960 this patch: 960
netdev/checkpatch warning WARNING: line length of 81 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-26--06-00 (tests: 944)

Commit Message

Su Hui March 25, 2024, 7:35 a.m. UTC
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>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Subbaraya Sundeep March 25, 2024, 12:44 p.m. UTC | #1
Hi,

>-----Original Message-----
>From: Su Hui <suhui@nfschina.com>
>Sent: Monday, March 25, 2024 1:06 PM
>To: Sunil Kovvuri Goutham <sgoutham@marvell.com>; Geethasowjanya Akula
><gakula@marvell.com>; Subbaraya Sundeep Bhatta <sbhatta@marvell.com>;
>Hariprasad Kelam <hkelam@marvell.com>; davem@davemloft.net;
>edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
>nathan@kernel.org; ndesaulniers@google.com; morbo@google.com;
>justinstitt@google.com
>Cc: Su Hui <suhui@nfschina.com>; netdev@vger.kernel.org; linux-
>kernel@vger.kernel.org; llvm@lists.linux.dev; kernel-janitors@vger.kernel.org
>Subject: [PATCH 2/2] 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]
>
Consider this also as a fix and add Fixes tag. Also please add "net" in subject to
easily identify whether this patch as net or net-next material.

Thanks,
Sundeep

>Remove these unused variables to save some space.
>
>Signed-off-by: Su Hui <suhui@nfschina.com>
>---
> 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
Dan Carpenter March 25, 2024, 3:36 p.m. UTC | #2
On Mon, Mar 25, 2024 at 12:44:44PM +0000, Subbaraya Sundeep Bhatta wrote:
> Hi,
> 
> >-----Original Message-----
> >From: Su Hui <suhui@nfschina.com>
> >Sent: Monday, March 25, 2024 1:06 PM
> >To: Sunil Kovvuri Goutham <sgoutham@marvell.com>; Geethasowjanya Akula
> ><gakula@marvell.com>; Subbaraya Sundeep Bhatta <sbhatta@marvell.com>;
> >Hariprasad Kelam <hkelam@marvell.com>; davem@davemloft.net;
> >edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
> >nathan@kernel.org; ndesaulniers@google.com; morbo@google.com;
> >justinstitt@google.com
> >Cc: Su Hui <suhui@nfschina.com>; netdev@vger.kernel.org; linux-
> >kernel@vger.kernel.org; llvm@lists.linux.dev; kernel-janitors@vger.kernel.org
> >Subject: [PATCH 2/2] 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]
> >
> Consider this also as a fix and add Fixes tag. Also please add "net" in subject to
> easily identify whether this patch as net or net-next material.
> 

It's not a bug fix so it doesn't need a Fixes tag.

regards,
dan carpenter
diff mbox series

Patch

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;