netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: andrew@lunn.ch
Cc: Joao.Pinto@synopsys.com, Jose.Abreu@synopsys.com,
	netdev@vger.kernel.org, peppe.cavallaro@st.com,
	alexandre.torgue@st.com
Subject: Re: [PATCH net-next 2/2] net: stmmac: Add support for DWMAC5 and implement Safety Features
Date: Thu, 01 Feb 2018 10:09:18 -0500 (EST)	[thread overview]
Message-ID: <20180201.100918.842039702040652176.davem@davemloft.net> (raw)
In-Reply-To: <20180201150209.GB16818@lunn.ch>

From: Andrew Lunn <andrew@lunn.ch>
Date: Thu, 1 Feb 2018 16:02:09 +0100

>> +static void dwmac5_log_error(struct net_device *ndev, u32 value, bool corr,
>> +		const char *module_name, const char **errors_str) {
>> +	unsigned long loc, mask;
>> +
>> +	mask = value;
>> +	for_each_set_bit(loc, &mask, 32) {
>> +		netdev_err(ndev, "Found %s error in %s: '%s'\n", corr ?
>> +				"correctable" : "uncorrectable", module_name,
>> +				errors_str[loc]);
>> +	}
>> +}
> 
> How about also adding ethtool -S stats. You have a text string, so all
> you need to add is a counter. And i expect statistics are looked at
> more than dmesg output.

I agree.  Perhaps for extremely catastrophic errors (those which
require a complete chip reset, for example), statistics are really the
way to go.

Also, all of these functions are not style properly.  The openning
curly braces of a function belong on a separate line of their own, not
at the end of the arguments.

The braces for structure assignment blocks have a similar problem,
the final closing brace and semicolon should be on a line by itself.

  reply	other threads:[~2018-02-01 15:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 14:41 [PATCH net-next 0/2] Fix TX Timeout and implement Safety Features Jose Abreu
2018-02-01 14:41 ` [PATCH net-next 1/2] net: stmmac: Rework and fix TX Timeout code Jose Abreu
2018-02-01 14:41 ` [PATCH net-next 2/2] net: stmmac: Add support for DWMAC5 and implement Safety Features Jose Abreu
2018-02-01 14:44   ` Joao Pinto
2018-02-01 15:02     ` Andrew Lunn
2018-02-01 15:09       ` David Miller [this message]
2018-02-01 15:26         ` Jose Abreu
2018-02-01 15:33           ` David Miller
2018-02-01 15:18       ` Jose Abreu

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=20180201.100918.842039702040652176.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --cc=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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).