netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: netdev@vger.kernel.org
Subject: [PATCH 3/4] FDDI: defza: Move SMT Tx data buffer declaration next to its skb
Date: Wed, 7 Nov 2018 12:07:05 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LFD.2.21.1811071137190.20378@eddie.linux-mips.org> (raw)
In-Reply-To: <alpine.LFD.2.21.1811070323450.20378@eddie.linux-mips.org>

Move the temporary data buffer used when tapping into the SMT Tx queue 
from the outer function level into the conditional block it's actually 
used in and its containing skb is also declared, making the structure of 
code better.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Hi,

 This was also present, though not further complained about in kbuild bot 
output:

drivers/net/fddi/defza.c:787:45: warning: unused variable 'skb_data_ptr' [-Wunused-variable]

because it ran on a tree revision as at commit 61414f5ec983 ("FDDI: defza: 
Add support for DEC FDDIcontroller 700 TURBOchannel adapter") and 
therefore without commit 9f9a742db40f ("FDDI: defza: Support capturing 
outgoing SMT traffic"), indicating that the buffer should have been 
declared in the containing block rather than at the function level, 
especially as the skb it comes from is also declared within that block.

  Maciej
---
 drivers/net/fddi/defza.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

linux-defza-skb-data-ptr-fix.diff
Index: linux-20181104-4maxp64/drivers/net/fddi/defza.c
===================================================================
--- linux-20181104-4maxp64.orig/drivers/net/fddi/defza.c
+++ linux-20181104-4maxp64/drivers/net/fddi/defza.c
@@ -784,7 +784,7 @@ static void fza_rx(struct net_device *de
 static void fza_tx_smt(struct net_device *dev)
 {
 	struct fza_private *fp = netdev_priv(dev);
-	struct fza_buffer_tx __iomem *smt_tx_ptr, *skb_data_ptr;
+	struct fza_buffer_tx __iomem *smt_tx_ptr;
 	int i, len;
 	u32 own;
 
@@ -799,6 +799,7 @@ static void fza_tx_smt(struct net_device
 
 		if (!netif_queue_stopped(dev)) {
 			if (dev_nit_active(dev)) {
+				struct fza_buffer_tx *skb_data_ptr;
 				struct sk_buff *skb;
 
 				/* Length must be a multiple of 4 as only word

  parent reply	other threads:[~2018-11-07 21:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 12:06 [PATCH 0/4] FDDI: defza: Fix a bunch of small issues Maciej W. Rozycki
2018-11-07 12:06 ` [PATCH 1/4] FDDI: defza: Fix SPDX annotation Maciej W. Rozycki
2018-11-07 12:06 ` [PATCH 2/4] FDDI: defza: Add missing comment closing Maciej W. Rozycki
2018-11-07 12:07 ` Maciej W. Rozycki [this message]
2018-11-07 12:07 ` [PATCH 4/4] FDDI: defza: Make the driver version string constant Maciej W. Rozycki
2018-11-08  5:53 ` [PATCH 0/4] FDDI: defza: Fix a bunch of small issues David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.21.1811071137190.20378@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).