Netdev List
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
To: Joe Perches <joe@perches.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 03/15] net: sgi: ioc3-eth: remove checkpatch errors/warning
Date: Wed, 28 Aug 2019 21:55:01 +0200	[thread overview]
Message-ID: <20190828215501.e3a9f2fdf7235f8a7d1b0e7c@suse.de> (raw)
In-Reply-To: <d0fd02c3634d187dcfe5487917099bc1905e3789.camel@perches.com>

On Wed, 28 Aug 2019 10:10:18 -0700
Joe Perches <joe@perches.com> wrote:

> On Wed, 2019-08-28 at 16:03 +0200, Thomas Bogendoerfer wrote:
> > Before massaging the driver further fix oddities found by checkpatch like
> > - wrong indention
> > - comment formatting
> > - use of printk instead or netdev_xxx/pr_xxx
> 
> trivial notes:
> 
> Please try to make the code better rather than merely
> shutting up checkpatch.

that's the overall goal.

> 
> > diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
> []
> > @@ -209,8 +201,7 @@ static inline void nic_write_bit(u32 __iomem *mcr, int bit)
> >  	nic_wait(mcr);
> >  }
> >  
> > -/*
> > - * Read a byte from an iButton device
> > +/* Read a byte from an iButton device
> >   */
> 
> These comment styles would be simpler on a single line
> 
> /* Read a byte from an iButton device */
> 
> >  static u32 nic_read_byte(u32 __iomem *mcr)
> >  {
> > @@ -223,8 +214,7 @@ static u32 nic_read_byte(u32 __iomem *mcr)
> >  	return result;
> >  }
> >  
> > -/*
> > - * Write a byte to an iButton device
> > +/* Write a byte to an iButton device
> >   */
> 
> /* Write a byte to an iButton device */
> 
> etc...
> 
> []
> > @@ -323,16 +315,15 @@ static int nic_init(u32 __iomem *mcr)
> >  		break;
> >  	}
> >  
> > -	printk("Found %s NIC", type);
> > +	pr_info("Found %s NIC", type);
> >  	if (type != unknown)
> > -		printk (" registration number %pM, CRC %02x", serial, crc);
> > -	printk(".\n");
> > +		pr_cont(" registration number %pM, CRC %02x", serial, crc);
> > +	pr_cont(".\n");
> 
> This code would be more sensible as
> 
> 	if (type != unknown)
> 		pr_info("Found %s NIC registration number %pM, CRC %02x\n",
> 			type, serial, crc);
> 	else
> 		pr_info("Found %s NIC\n", type); 
> 
> Though I don't know if registration number is actually a MAC
> address or something else.  If it's just a 6 byte identifier
> that uses colon separation it should probably use "%6phC"
> instead of "%pM"

all of the code above will entirely go away with the conversion to MFD.

> > @@ -645,22 +636,21 @@ static inline void ioc3_tx(struct net_device *dev)
> >  static void ioc3_error(struct net_device *dev, u32 eisr)
> >  {
> >  	struct ioc3_private *ip = netdev_priv(dev);
> > -	unsigned char *iface = dev->name;
> >  
> >  	spin_lock(&ip->ioc3_lock);
> >  
> >  	if (eisr & EISR_RXOFLO)
> > -		printk(KERN_ERR "%s: RX overflow.\n", iface);
> > +		netdev_err(dev, "RX overflow.\n");
> >  	if (eisr & EISR_RXBUFOFLO)
> > -		printk(KERN_ERR "%s: RX buffer overflow.\n", iface);
> > +		netdev_err(dev, "RX buffer overflow.\n");
> >  	if (eisr & EISR_RXMEMERR)
> > -		printk(KERN_ERR "%s: RX PCI error.\n", iface);
> > +		netdev_err(dev, "RX PCI error.\n");
> >  	if (eisr & EISR_RXPARERR)
> > -		printk(KERN_ERR "%s: RX SSRAM parity error.\n", iface);
> > +		netdev_err(dev, "RX SSRAM parity error.\n");
> >  	if (eisr & EISR_TXBUFUFLO)
> > -		printk(KERN_ERR "%s: TX buffer underflow.\n", iface);
> > +		netdev_err(dev, "TX buffer underflow.\n");
> >  	if (eisr & EISR_TXMEMERR)
> > -		printk(KERN_ERR "%s: TX PCI error.\n", iface);
> > +		netdev_err(dev, "TX PCI error.\n");
> 
> All of these should probably be ratelimited() output.

good point, will change it.

Thanks,
Thomas.

-- 
SUSE Software Solutions Germany GmbH
HRB 247165 (AG München)
Geschäftsführer: Felix Imendörffer

  reply	other threads:[~2019-08-28 19:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 14:02 [PATCH net-next 00/15] ioc3-eth improvements Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 01/15] MIPS: SGI-IP27: remove ioc3 ethernet init Thomas Bogendoerfer
2019-08-28 20:45   ` Paul Burton
2019-08-28 14:03 ` [PATCH net-next 02/15] MIPS: SGI-IP27: restructure ioc3 register access Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 03/15] net: sgi: ioc3-eth: remove checkpatch errors/warning Thomas Bogendoerfer
2019-08-28 17:10   ` Joe Perches
2019-08-28 19:55     ` Thomas Bogendoerfer [this message]
2019-08-28 14:03 ` [PATCH net-next 04/15] net: sgi: ioc3-eth: use defines for constants dealing with desc rings Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 05/15] net: sgi: ioc3-eth: allocate space for desc rings only once Thomas Bogendoerfer
2019-08-28 22:58   ` Jakub Kicinski
2019-08-28 14:03 ` [PATCH net-next 06/15] net: sgi: ioc3-eth: get rid of ioc3_clean_rx_ring() Thomas Bogendoerfer
2019-08-28 23:02   ` Jakub Kicinski
2019-08-29  8:52     ` Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 07/15] net: sgi: ioc3-eth: separate tx and rx ring handling Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 08/15] net: sgi: ioc3-eth: introduce chip start function Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 09/15] net: sgi: ioc3-eth: split ring cleaning/freeing and allocation Thomas Bogendoerfer
2019-08-28 23:04   ` Jakub Kicinski
2019-08-28 14:03 ` [PATCH net-next 10/15] net: sgi: ioc3-eth: refactor rx buffer allocation Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 11/15] net: sgi: ioc3-eth: use dma-direct for dma allocations Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 12/15] net: sgi: ioc3-eth: use csum_fold Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 13/15] net: sgi: ioc3-eth: Fix IPG settings Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 14/15] net: sgi: ioc3-eth: protect emcr in all cases Thomas Bogendoerfer
2019-08-28 14:03 ` [PATCH net-next 15/15] net: sgi: ioc3-eth: no need to stop queue set_multicast_list Thomas Bogendoerfer

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=20190828215501.e3a9f2fdf7235f8a7d1b0e7c@suse.de \
    --to=tbogendoerfer@suse.de \
    --cc=davem@davemloft.net \
    --cc=jhogan@kernel.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.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