From patchwork Thu Jun 12 20:24:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zachary X-Patchwork-Id: 359324 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0940914009D for ; Fri, 13 Jun 2014 06:24:12 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbaFLUYG (ORCPT ); Thu, 12 Jun 2014 16:24:06 -0400 Received: from mail-qc0-f179.google.com ([209.85.216.179]:38370 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbaFLUYF (ORCPT ); Thu, 12 Jun 2014 16:24:05 -0400 Received: by mail-qc0-f179.google.com with SMTP id x3so1647623qcv.10 for ; Thu, 12 Jun 2014 13:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bdrd2hBreJA+e0xgT0d9iyIjcusrOaHMeGHTxl2lpoA=; b=p88QbUydwKVW9/IkWZOZrngcSdiBQGZCD96qXz2jhvosM/o1RT2Q4FsD+NYDj8+pBZ dwsnufSukdorOGfcJ9m85S7qsyyJWC3UWhl1nFbLdNZ6eNp4vy6PXLfB0hmxnZ6dnJKB u5+M1DKulnaWeBmDpjcE24sZ58zU0vqk8MzEUxpZU86h+IIAR6duv80PGYQqnti0+UAa yU7Sd8nQwlQT8UlsW4Fo4SkZ3U3pKgDEipdaJSeSoMLiklvVNXkxLuBvHyz88NAtQFMa 1nEnHKeAhaFkN7vSj3LBJBPYv8b6f6QuytHEPMWGXI8dip6GFj/Xtr28D/mt2rATxHmY 9JiQ== MIME-Version: 1.0 X-Received: by 10.140.106.202 with SMTP id e68mr59403706qgf.83.1402604643961; Thu, 12 Jun 2014 13:24:03 -0700 (PDT) Received: by 10.140.16.78 with HTTP; Thu, 12 Jun 2014 13:24:03 -0700 (PDT) In-Reply-To: References: Date: Thu, 12 Jun 2014 16:24:03 -0400 Message-ID: Subject: Re: Very Minor Patch to loopback.c From: Zachary To: netdev@vger.kernel.org Cc: "David S. Miller" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Updated due to Richard Weinberger's info in linux-kernel On Thu, Jun 12, 2014 at 3:53 PM, Zachary wrote: > Very minor patch to loopback.c that I noticed while comparing the > dummy.c code to loopback.c code (dummy.c was based on loopback.c). I > did not see a maintainer in MAINTAINERS in my cursory glance, so I > apologize if this is to the wrong place. I am testing this patch > right now on my laptop and it appears to be working without issues. > It also compiled without warnings. > > diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c > index bb96409..f9f88d7 100644 > --- a/drivers/net/loopback.c > +++ b/drivers/net/loopback.c > @@ -22,6 +22,7 @@ > * interface. > * Alexey Kuznetsov: Potential hang under some extreme > * cases removed. > + * Zachary Winnerman: Extremely minor patch in loopback_xmit > * > * This program is free software; you can redistribute it and/or > * modify it under the terms of the GNU General Public License > @@ -72,7 +73,6 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb, > struct net_device *dev) > { > struct pcpu_lstats *lb_stats; > - int len; > > skb_orphan(skb); > > @@ -86,10 +86,9 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb, > /* it's OK to use per_cpu_ptr() because BHs are off */ > lb_stats = this_cpu_ptr(dev->lstats); > > - len = skb->len; > if (likely(netif_rx(skb) == NET_RX_SUCCESS)) { > u64_stats_update_begin(&lb_ > stats->syncp); > - lb_stats->bytes += len; > + lb_stats->bytes += skb->len; > lb_stats->packets++; > u64_stats_update_end(&lb_stats->syncp); > } --- 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 --git a/drivers/net/loopback.c b/drivers/net/loopback.c index bb96409..fc03883 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -72,7 +72,6 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb, struct net_device *dev) { struct pcpu_lstats *lb_stats; - int len; skb_orphan(skb); @@ -86,10 +85,9 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb, /* it's OK to use per_cpu_ptr() because BHs are off */ lb_stats = this_cpu_ptr(dev->lstats); - len = skb->len; if (likely(netif_rx(skb) == NET_RX_SUCCESS)) { u64_stats_update_begin(&lb_stats->syncp); - lb_stats->bytes += len; + lb_stats->bytes += skb->len; lb_stats->packets++; u64_stats_update_end(&lb_stats->syncp); }