Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1324965ybl; Wed, 28 Aug 2019 12:57:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwHcOGuD2fBC8bbsJI5DJlFJ7dZYuCiUjW2SP31c//fkPMSyCow39on5IjbZIrfHhKyr9v X-Received: by 2002:a17:90a:800a:: with SMTP id b10mr5780057pjn.23.1567022246427; Wed, 28 Aug 2019 12:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567022246; cv=none; d=google.com; s=arc-20160816; b=w3GQ09aS3se+PbSBzg89hCGajjSvMMM4yT2i3s5IwedtougegbLyzglTz41/2W1AZV LznwJp+rOf1PqghKKXZDdMQamKQOClJAMBzzVghQg+C1Vj5gZn6cBsGxMdeEO7c4htfH KddyI80fPGwmbbqnjwpPeTMvXh56EFU1aKqiohRZGBxo0z93sfM8viIQHZjo44A0HUns MB+7Gj48p3ZvMWpvttEE+l/4aI/K9JbWRTalxz/+lczv2lAYC8bAzCvwVabA3oRLbgn+ rb7lHBN8aqePSZKTmyTLID+6XXZ98dvi5Uq3+Kirt4tWB8PQGaPsBuQ3PDqe9TA7uEDA QlJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=NaYquEhmgaZjI75h6xcbCYLRh0AxPVtuNt9yLw+FXrs=; b=IY0wNxof3dBJiexLzoGZliWd21C04sWX58u22YvwRA8laQcoi8K6OjFzOLDByeHpv4 MbZKp0zdLClT4xUw9wOmMT6e3vzRMSSqa0EPtbK1f6BNt9o/MDHAmkgl0ks59zIObhZT L/P1IUYXqq3z6zjHJerh2LNHEIWTSdFg4HhlBb/TXvBJsBkaQIa/R05LfMo+uDB9PGn3 XDTeyoPrngiSpYyBzqCE3I1GwndDDgpadEJW8P0s7UH0wfUxoQQnggAGzkHhUKG6oO8X f1o/icSlkR/QB3lDfxfVJenCbPF6T+kGOmpnjRrRIOAqmeiTPEp1/eFsgURtHqsorQRC hzUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si158880pfn.199.2019.08.28.12.57.10; Wed, 28 Aug 2019 12:57:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbfH1TzE convert rfc822-to-8bit (ORCPT + 99 others); Wed, 28 Aug 2019 15:55:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:44184 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726591AbfH1TzE (ORCPT ); Wed, 28 Aug 2019 15:55:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2080DAD45; Wed, 28 Aug 2019 19:55:02 +0000 (UTC) Date: Wed, 28 Aug 2019 21:55:01 +0200 From: Thomas Bogendoerfer To: Joe Perches Cc: Ralf Baechle , Paul Burton , James Hogan , "David S. Miller" , 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 Message-Id: <20190828215501.e3a9f2fdf7235f8a7d1b0e7c@suse.de> In-Reply-To: References: <20190828140315.17048-1-tbogendoerfer@suse.de> <20190828140315.17048-4-tbogendoerfer@suse.de> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Aug 2019 10:10:18 -0700 Joe Perches 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