netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: David Daney <david.daney@cavium.com>,
	"David S. Miller" <davem@davemloft.net>,
	Luka Perkov <luka@openwrt.org>,
	Willem de Bruijn <willemb@google.com>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netdev: octeon_mgmt: ISO C90 forbids mixed declarations and code
Date: Sat, 13 Sep 2014 12:11:12 -0700	[thread overview]
Message-ID: <1410635472.917.1.camel@joe-AO725> (raw)
In-Reply-To: <1410635108-3589-1-git-send-email-xypron.glpk@gmx.de>

On Sat, 2014-09-13 at 21:05 +0200, Heinrich Schuchardt wrote:
> Compiling with OCTEON_MGMT_ETHERNET gives a warning
> drivers/net/ethernet/octeon/octeon_mgmt.c:295:4:
> warning: ISO C90 forbids mixed declarations and code
> [-Wdeclaration-after-statement]

Maybe better to move the memset after the declaration.

> diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
[]
> @@ -254,6 +254,7 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
>  	struct sk_buff *skb;
>  	int cleaned = 0;
>  	unsigned long flags;
> +	u64 ns;
>  
>  	mix_orcnt.u64 = cvmx_read_csr(p->mix + MIX_ORCNT);
>  	while (mix_orcnt.s.orcnt) {
> @@ -292,7 +293,7 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
>  			struct skb_shared_hwtstamps ts;
>  			memset(&ts, 0, sizeof(ts));
>  			/* Read the timestamp */
> -			u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
> +			ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
>  			/* Remove the timestamp from the FIFO */
>  			cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0);
>  			/* Tell the kernel about the timestamp */

  reply	other threads:[~2014-09-13 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-13 19:05 [PATCH] netdev: octeon_mgmt: ISO C90 forbids mixed declarations and code Heinrich Schuchardt
2014-09-13 19:11 ` Joe Perches [this message]
2014-09-13 20:03   ` 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=1410635472.917.1.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luka@openwrt.org \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=willemb@google.com \
    --cc=xypron.glpk@gmx.de \
    /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).