From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Maciej W. Rozycki" 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) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: netdev@vger.kernel.org Return-path: Received: from eddie.linux-mips.org ([148.251.95.138]:37340 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbeKGVhL (ORCPT ); Wed, 7 Nov 2018 16:37:11 -0500 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23992446AbeKGMHFCE0mO (ORCPT ); Wed, 7 Nov 2018 13:07:05 +0100 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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