diff mbox

[net-next,1/2] xen-netback: remove redundent parameter in netbk_count_requests

Message ID 1367340644-19690-2-git-send-email-wei.liu2@citrix.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Liu April 30, 2013, 4:50 p.m. UTC
Tracking down from the caller, first_idx is always equal to vif->tx.req_cons.
Remove it to avoid confusion.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 drivers/net/xen-netback/netback.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ian Campbell May 1, 2013, 10:10 a.m. UTC | #1
On Tue, 2013-04-30 at 17:50 +0100, Wei Liu wrote:
> Tracking down from the caller, first_idx is always equal to vif->tx.req_cons.
> Remove it to avoid confusion.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  drivers/net/xen-netback/netback.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index a2865f1..c44772d 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -928,7 +928,6 @@ static void netbk_fatal_tx_err(struct xenvif *vif)
>  
>  static int netbk_count_requests(struct xenvif *vif,
>  				struct xen_netif_tx_request *first,
> -				RING_IDX first_idx,
>  				struct xen_netif_tx_request *txp,
>  				int work_to_do)
>  {
> @@ -1005,7 +1004,7 @@ static int netbk_count_requests(struct xenvif *vif,
>  	} while ((txp++)->flags & XEN_NETTXF_more_data);
>  
>  	if (drop_err) {
> -		netbk_tx_err(vif, first, first_idx + slots);
> +		netbk_tx_err(vif, first, cons + slots);
>  		return drop_err;
>  	}
>  
> @@ -1470,8 +1469,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
>  				continue;
>  		}
>  
> -		ret = netbk_count_requests(vif, &txreq, idx,
> -					   txfrags, work_to_do);
> +		ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do);
>  		if (unlikely(ret < 0))
>  			continue;
>  


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Beulich May 2, 2013, 9:31 a.m. UTC | #2
>>> On 30.04.13 at 18:50, Wei Liu <wei.liu2@citrix.com> wrote:
> Tracking down from the caller, first_idx is always equal to vif->tx.req_cons.
> Remove it to avoid confusion.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Suggested-by: Jan Beulich <jbeulich@suse.com>

> ---
>  drivers/net/xen-netback/netback.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/netback.c 
> b/drivers/net/xen-netback/netback.c
> index a2865f1..c44772d 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -928,7 +928,6 @@ static void netbk_fatal_tx_err(struct xenvif *vif)
>  
>  static int netbk_count_requests(struct xenvif *vif,
>  				struct xen_netif_tx_request *first,
> -				RING_IDX first_idx,
>  				struct xen_netif_tx_request *txp,
>  				int work_to_do)
>  {
> @@ -1005,7 +1004,7 @@ static int netbk_count_requests(struct xenvif *vif,
>  	} while ((txp++)->flags & XEN_NETTXF_more_data);
>  
>  	if (drop_err) {
> -		netbk_tx_err(vif, first, first_idx + slots);
> +		netbk_tx_err(vif, first, cons + slots);
>  		return drop_err;
>  	}
>  
> @@ -1470,8 +1469,7 @@ static unsigned xen_netbk_tx_build_gops(struct 
> xen_netbk *netbk)
>  				continue;
>  		}
>  
> -		ret = netbk_count_requests(vif, &txreq, idx,
> -					   txfrags, work_to_do);
> +		ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do);
>  		if (unlikely(ret < 0))
>  			continue;
>  
> -- 
> 1.7.10.4



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index a2865f1..c44772d 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -928,7 +928,6 @@  static void netbk_fatal_tx_err(struct xenvif *vif)
 
 static int netbk_count_requests(struct xenvif *vif,
 				struct xen_netif_tx_request *first,
-				RING_IDX first_idx,
 				struct xen_netif_tx_request *txp,
 				int work_to_do)
 {
@@ -1005,7 +1004,7 @@  static int netbk_count_requests(struct xenvif *vif,
 	} while ((txp++)->flags & XEN_NETTXF_more_data);
 
 	if (drop_err) {
-		netbk_tx_err(vif, first, first_idx + slots);
+		netbk_tx_err(vif, first, cons + slots);
 		return drop_err;
 	}
 
@@ -1470,8 +1469,7 @@  static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk)
 				continue;
 		}
 
-		ret = netbk_count_requests(vif, &txreq, idx,
-					   txfrags, work_to_do);
+		ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do);
 		if (unlikely(ret < 0))
 			continue;