All of lore.kernel.org
 help / color / mirror / Atom feed
* [Outreachy kernel] [PATCH] net: ethernet: Drop unnecessary continue
@ 2018-03-03 13:09 ` Arushi Singhal
  0 siblings, 0 replies; 4+ messages in thread
From: Arushi Singhal @ 2018-03-03 13:09 UTC (permalink / raw)
  To: jdmason
  Cc: Jakub Kicinski, netdev, linux-kernel, oss-drivers, outreachy-kernel

Continue at the bottom of a loop are removed.
Issue found using drop_continue.cocci Coccinelle script.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/net/ethernet/amd/ni65.c                   | 1 -
 drivers/net/ethernet/neterion/s2io.c              | 1 -
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 1 -
 3 files changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
index e248d1a..5975f29 100644
--- a/drivers/net/ethernet/amd/ni65.c
+++ b/drivers/net/ethernet/amd/ni65.c
@@ -437,7 +437,6 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)
 			for(j=0;j<3;j++)
 				if(inb(ioaddr+cards[i].addr_offset+j) != cards[i].vendor_id[j]) {
 					release_region(ioaddr, cards[i].total_size);
-					continue;
 			  }
 		}
 		break;
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index b8983e7..5123abd 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -3682,7 +3682,6 @@ static void restore_xmsi_data(struct s2io_nic *nic)
 		if (wait_for_msix_trans(nic, msix_index)) {
 			DBG_PRINT(ERR_DBG, "%s: index: %d failed\n",
 				  __func__, msix_index);
-			continue;
 		}
 	}
 }
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
index 15fa47f..77916ed 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
@@ -260,7 +260,6 @@ nfp_net_pf_alloc_vnics(struct nfp_pf *pf, void __iomem *ctrl_bar,
 		/* Kill the vNIC if app init marked it as invalid */
 		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
 			nfp_net_pf_free_vnic(pf, nn);
-			continue;
 		}
 	}
 
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
To post to this group, send email to outreachy-kernel@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180303130933.GA8337%40seema-Inspiron-15-3567.
For more options, visit https://groups.google.com/d/optout.

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

* [PATCH] net: ethernet: Drop unnecessary continue
@ 2018-03-03 13:09 ` Arushi Singhal
  0 siblings, 0 replies; 4+ messages in thread
From: Arushi Singhal @ 2018-03-03 13:09 UTC (permalink / raw)
  To: jdmason
  Cc: Jakub Kicinski, netdev, linux-kernel, oss-drivers, outreachy-kernel

Continue at the bottom of a loop are removed.
Issue found using drop_continue.cocci Coccinelle script.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/net/ethernet/amd/ni65.c                   | 1 -
 drivers/net/ethernet/neterion/s2io.c              | 1 -
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 1 -
 3 files changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
index e248d1a..5975f29 100644
--- a/drivers/net/ethernet/amd/ni65.c
+++ b/drivers/net/ethernet/amd/ni65.c
@@ -437,7 +437,6 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)
 			for(j=0;j<3;j++)
 				if(inb(ioaddr+cards[i].addr_offset+j) != cards[i].vendor_id[j]) {
 					release_region(ioaddr, cards[i].total_size);
-					continue;
 			  }
 		}
 		break;
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index b8983e7..5123abd 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -3682,7 +3682,6 @@ static void restore_xmsi_data(struct s2io_nic *nic)
 		if (wait_for_msix_trans(nic, msix_index)) {
 			DBG_PRINT(ERR_DBG, "%s: index: %d failed\n",
 				  __func__, msix_index);
-			continue;
 		}
 	}
 }
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
index 15fa47f..77916ed 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
@@ -260,7 +260,6 @@ nfp_net_pf_alloc_vnics(struct nfp_pf *pf, void __iomem *ctrl_bar,
 		/* Kill the vNIC if app init marked it as invalid */
 		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
 			nfp_net_pf_free_vnic(pf, nn);
-			continue;
 		}
 	}
 
-- 
2.7.4



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

* Re: [Outreachy kernel] [PATCH] net: ethernet: Drop unnecessary continue
  2018-03-03 13:09 ` Arushi Singhal
@ 2018-03-03 14:06   ` Julia Lawall
  -1 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2018-03-03 14:06 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: jdmason, Jakub Kicinski, netdev, linux-kernel, oss-drivers,
	outreachy-kernel



On Sat, 3 Mar 2018, Arushi Singhal wrote:

> Continue at the bottom of a loop are removed.
> Issue found using drop_continue.cocci Coccinelle script.

In each case you leave an if with a single statement in the branch.  In
that case the { } should be dropped too.

julia

>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/net/ethernet/amd/ni65.c                   | 1 -
>  drivers/net/ethernet/neterion/s2io.c              | 1 -
>  drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
> index e248d1a..5975f29 100644
> --- a/drivers/net/ethernet/amd/ni65.c
> +++ b/drivers/net/ethernet/amd/ni65.c
> @@ -437,7 +437,6 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)
>  			for(j=0;j<3;j++)
>  				if(inb(ioaddr+cards[i].addr_offset+j) != cards[i].vendor_id[j]) {
>  					release_region(ioaddr, cards[i].total_size);
> -					continue;
>  			  }
>  		}
>  		break;
> diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
> index b8983e7..5123abd 100644
> --- a/drivers/net/ethernet/neterion/s2io.c
> +++ b/drivers/net/ethernet/neterion/s2io.c
> @@ -3682,7 +3682,6 @@ static void restore_xmsi_data(struct s2io_nic *nic)
>  		if (wait_for_msix_trans(nic, msix_index)) {
>  			DBG_PRINT(ERR_DBG, "%s: index: %d failed\n",
>  				  __func__, msix_index);
> -			continue;
>  		}
>  	}
>  }
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> index 15fa47f..77916ed 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> @@ -260,7 +260,6 @@ nfp_net_pf_alloc_vnics(struct nfp_pf *pf, void __iomem *ctrl_bar,
>  		/* Kill the vNIC if app init marked it as invalid */
>  		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
>  			nfp_net_pf_free_vnic(pf, nn);
> -			continue;
>  		}
>  	}
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180303130933.GA8337%40seema-Inspiron-15-3567.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
To post to this group, send email to outreachy-kernel@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.20.1803031506060.2302%40hadrien.
For more options, visit https://groups.google.com/d/optout.

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

* Re: [Outreachy kernel] [PATCH] net: ethernet: Drop unnecessary continue
@ 2018-03-03 14:06   ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2018-03-03 14:06 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: jdmason, Jakub Kicinski, netdev, linux-kernel, oss-drivers,
	outreachy-kernel



On Sat, 3 Mar 2018, Arushi Singhal wrote:

> Continue at the bottom of a loop are removed.
> Issue found using drop_continue.cocci Coccinelle script.

In each case you leave an if with a single statement in the branch.  In
that case the { } should be dropped too.

julia

>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/net/ethernet/amd/ni65.c                   | 1 -
>  drivers/net/ethernet/neterion/s2io.c              | 1 -
>  drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
> index e248d1a..5975f29 100644
> --- a/drivers/net/ethernet/amd/ni65.c
> +++ b/drivers/net/ethernet/amd/ni65.c
> @@ -437,7 +437,6 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)
>  			for(j=0;j<3;j++)
>  				if(inb(ioaddr+cards[i].addr_offset+j) != cards[i].vendor_id[j]) {
>  					release_region(ioaddr, cards[i].total_size);
> -					continue;
>  			  }
>  		}
>  		break;
> diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
> index b8983e7..5123abd 100644
> --- a/drivers/net/ethernet/neterion/s2io.c
> +++ b/drivers/net/ethernet/neterion/s2io.c
> @@ -3682,7 +3682,6 @@ static void restore_xmsi_data(struct s2io_nic *nic)
>  		if (wait_for_msix_trans(nic, msix_index)) {
>  			DBG_PRINT(ERR_DBG, "%s: index: %d failed\n",
>  				  __func__, msix_index);
> -			continue;
>  		}
>  	}
>  }
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> index 15fa47f..77916ed 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
> @@ -260,7 +260,6 @@ nfp_net_pf_alloc_vnics(struct nfp_pf *pf, void __iomem *ctrl_bar,
>  		/* Kill the vNIC if app init marked it as invalid */
>  		if (nn->port && nn->port->type == NFP_PORT_INVALID) {
>  			nfp_net_pf_free_vnic(pf, nn);
> -			continue;
>  		}
>  	}
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180303130933.GA8337%40seema-Inspiron-15-3567.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2018-03-03 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-03 13:09 [Outreachy kernel] [PATCH] net: ethernet: Drop unnecessary continue Arushi Singhal
2018-03-03 13:09 ` Arushi Singhal
2018-03-03 14:06 ` [Outreachy kernel] " Julia Lawall
2018-03-03 14:06   ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.