netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open()
@ 2024-03-26  6:12 Su Hui
  2024-03-26  6:12 ` [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Su Hui @ 2024-03-26  6:12 UTC (permalink / raw)
  To: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni
  Cc: Su Hui, saikrishnag, netdev, linux-kernel, kernel-janitors

otx2_rxtx_enable() return negative error code such as -EIO,
check -EIO rather than EIO to fix this problem.

Fixes: c926252205c4 ("octeontx2-pf: Disable packet I/O for graceful exit")
Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
v2: add "net" in subject
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index b40bd0e46751..3f46d5e0fb2e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -1933,7 +1933,7 @@ int otx2_open(struct net_device *netdev)
 	 * mcam entries are enabled to receive the packets. Hence disable the
 	 * packet I/O.
 	 */
-	if (err == EIO)
+	if (err == -EIO)
 		goto err_disable_rxtx;
 	else if (err)
 		goto err_tx_stop_queues;
-- 
2.30.2


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

* [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr
  2024-03-26  6:12 [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Su Hui
@ 2024-03-26  6:12 ` Su Hui
  2024-03-26 14:27   ` Simon Horman
  2024-03-26 14:19 ` [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Simon Horman
  2024-03-26 15:51 ` Kalesh Anakkur Purayil
  2 siblings, 1 reply; 5+ messages in thread
From: Su Hui @ 2024-03-26  6:12 UTC (permalink / raw)
  To: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	nathan, ndesaulniers, morbo, justinstitt
  Cc: Su Hui, 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>
---
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] 5+ messages in thread

* Re: [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open()
  2024-03-26  6:12 [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Su Hui
  2024-03-26  6:12 ` [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
@ 2024-03-26 14:19 ` Simon Horman
  2024-03-26 15:51 ` Kalesh Anakkur Purayil
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2024-03-26 14:19 UTC (permalink / raw)
  To: Su Hui
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	saikrishnag, netdev, linux-kernel, kernel-janitors

On Tue, Mar 26, 2024 at 02:12:34PM +0800, Su Hui wrote:
> otx2_rxtx_enable() return negative error code such as -EIO,
> check -EIO rather than EIO to fix this problem.
> 
> Fixes: c926252205c4 ("octeontx2-pf: Disable packet I/O for graceful exit")
> Signed-off-by: Su Hui <suhui@nfschina.com>
> Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>

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

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

* Re: [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr
  2024-03-26  6:12 ` [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
@ 2024-03-26 14:27   ` Simon Horman
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2024-03-26 14:27 UTC (permalink / raw)
  To: Su Hui
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	nathan, ndesaulniers, morbo, justinstitt, netdev, linux-kernel,
	llvm, kernel-janitors, Dan Carpenter

+ Dan Carpenter

On Tue, Mar 26, 2024 at 02:12:36PM +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>

Hi Su Hui,

as pointed out by Dan in his review of v1 of this patch, it is not a fix.
This means that it should be targeted at the net-next rather than the net
branch. As the granularity of patch handling on netdev is generally at the
patchset level I believe that this means that you need to separately,
in different email threads, repost:

1. Patch 1/2 of this series, targeted at net

   [PATCH net v3] octeontx2-pf: check negative error code in otx2_open()

2. Patch 2/2 of this series, targeted at net-next

   [PATCH net-next v3] octeontx2-pf: remove unused variables req_hdr

Also, please be sure to wait 24 hours since the posting of this patch-set
before reposting.

Some more information can be found here:
https://docs.kernel.org/process/maintainer-netdev.html

...

-- 
pw-bot: changes-requested

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

* Re: [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open()
  2024-03-26  6:12 [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Su Hui
  2024-03-26  6:12 ` [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
  2024-03-26 14:19 ` [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Simon Horman
@ 2024-03-26 15:51 ` Kalesh Anakkur Purayil
  2 siblings, 0 replies; 5+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-03-26 15:51 UTC (permalink / raw)
  To: Su Hui
  Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
	saikrishnag, netdev, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

On Tue, Mar 26, 2024 at 11:43 AM Su Hui <suhui@nfschina.com> wrote:
>
> otx2_rxtx_enable() return negative error code such as -EIO,
> check -EIO rather than EIO to fix this problem.
>
> Fixes: c926252205c4 ("octeontx2-pf: Disable packet I/O for graceful exit")
> Signed-off-by: Su Hui <suhui@nfschina.com>
> Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
> ---
LGTM
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> v2: add "net" in subject
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> index b40bd0e46751..3f46d5e0fb2e 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> @@ -1933,7 +1933,7 @@ int otx2_open(struct net_device *netdev)
>          * mcam entries are enabled to receive the packets. Hence disable the
>          * packet I/O.
>          */
> -       if (err == EIO)
> +       if (err == -EIO)
>                 goto err_disable_rxtx;
>         else if (err)
>                 goto err_tx_stop_queues;
> --
> 2.30.2
>
>


-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

end of thread, other threads:[~2024-03-26 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26  6:12 [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Su Hui
2024-03-26  6:12 ` [PATCH net v2 2/2] octeontx2-pf: remove unused variables req_hdr and rsp_hdr Su Hui
2024-03-26 14:27   ` Simon Horman
2024-03-26 14:19 ` [PATCH net v2 1/2] octeontx2-pf: check negative error code in otx2_open() Simon Horman
2024-03-26 15:51 ` Kalesh Anakkur Purayil

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).