mbox series

[00/12,Set,2] Rid W=1 warnings in Net

Message ID 20201104090610.1446616-1-lee.jones@linaro.org
Headers show
Series Rid W=1 warnings in Net | expand

Message

Lee Jones Nov. 4, 2020, 9:05 a.m. UTC
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

This is the last set.

Lee Jones (12):
  net: usb: lan78xx: Remove lots of set but unused 'ret' variables
  net: ethernet: smsc: smc911x: Mark 'status' as __maybe_unused
  net: ethernet: xilinx: xilinx_emaclite: Document 'txqueue' even if it
    is unused
  net: ethernet: smsc: smc91x: Demote non-conformant kernel function
    header
  net: xen-netback: xenbus: Demote nonconformant kernel-doc headers
  net: ethernet: ti: am65-cpsw-qos: Demote non-conformant function
    header
  net: ethernet: ti: am65-cpts: Document am65_cpts_rx_enable()'s 'en'
    parameter
  net: xen-netfront: Demote non-kernel-doc headers to standard comment
    blocks
  net: ethernet: ibm: ibmvnic: Fix some kernel-doc misdemeanours
  net: ethernet: toshiba: ps3_gelic_net: Fix some kernel-doc
    misdemeanours
  net: ethernet: toshiba: spider_net: Document a whole bunch of function
    parameters
  net: ethernet: ibm: ibmvnic: Fix some kernel-doc issues

 drivers/net/ethernet/ibm/ibmvnic.c            |  27 ++-
 drivers/net/ethernet/smsc/smc911x.c           |   6 +-
 drivers/net/ethernet/smsc/smc91x.c            |   2 +-
 drivers/net/ethernet/ti/am65-cpsw-qos.c       |   2 +-
 drivers/net/ethernet/ti/am65-cpts.c           |   2 +-
 drivers/net/ethernet/toshiba/ps3_gelic_net.c  |   9 +-
 drivers/net/ethernet/toshiba/spider_net.c     |  18 +-
 drivers/net/ethernet/xilinx/xilinx_emaclite.c |   1 +
 drivers/net/usb/lan78xx.c                     | 212 +++++++++---------
 drivers/net/xen-netback/xenbus.c              |   4 +-
 drivers/net/xen-netfront.c                    |   6 +-
 11 files changed, 141 insertions(+), 148 deletions(-)

Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: bpf@vger.kernel.org
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Dany Madden <drt@linux.ibm.com>
Cc: Daris A Nevil <dnevil@snmc.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dustin McIntire <dustin@sensoria.com>
Cc: Erik Stahlman <erik@vt.edu>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
Cc: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: John Allen <jallen@linux.vnet.ibm.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: John Williams <john.williams@xilinx.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: KP Singh <kpsingh@chromium.org>
Cc: Kurt Kanzenbach <kurt@linutronix.de>
Cc: Lijun Pan <ljp@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-usb@vger.kernel.org
Cc: Martin Habets <mhabets@solarflare.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Cc: netdev@vger.kernel.org
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Paul Durrant <paul@xen.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Cammaert <pc@denkart.be>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Santiago Leon <santi_leon@yahoo.com>
Cc: Shannon Nelson <snelson@pensando.io>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Cc: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Cc: Utz Bacher <utz.bacher@de.ibm.com>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Woojung Huh <woojung.huh@microchip.com>
Cc: xen-devel@lists.xenproject.org
Cc: Yonghong Song <yhs@fb.com>

Comments

Juergen Gross Nov. 4, 2020, 9:31 a.m. UTC | #1
On 04.11.20 10:06, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>   drivers/net/xen-netfront.c: In function ‘store_rxbuf’:
>   drivers/net/xen-netfront.c:2416:16: warning: variable ‘target’ set but not used [-Wunused-but-set-variable]

Those two warnings are not fixed by the patch.

>   drivers/net/xen-netfront.c:1592: warning: Function parameter or member 'dev' not described in 'netfront_probe'
>   drivers/net/xen-netfront.c:1592: warning: Function parameter or member 'id' not described in 'netfront_probe'
>   drivers/net/xen-netfront.c:1669: warning: Function parameter or member 'dev' not described in 'netfront_resume'
>   drivers/net/xen-netfront.c:2313: warning: Function parameter or member 'dev' not described in 'netback_changed'
>   drivers/net/xen-netfront.c:2313: warning: Function parameter or member 'backend_state' not described in 'netback_changed'
> 
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Jesper Dangaard Brouer <hawk@kernel.org>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Cc: Song Liu <songliubraving@fb.com>
> Cc: Yonghong Song <yhs@fb.com>
> Cc: Andrii Nakryiko <andrii@kernel.org>
> Cc: KP Singh <kpsingh@chromium.org>
> Cc: xen-devel@lists.xenproject.org
> Cc: netdev@vger.kernel.org
> Cc: bpf@vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

With the commit message fixed you can have my:

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
Andrew Lunn Nov. 4, 2020, 1:36 p.m. UTC | #2
On Wed, Nov 04, 2020 at 09:06:06AM +0000, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/net/xen-netfront.c: In function ‘store_rxbuf’:
>  drivers/net/xen-netfront.c:2416:16: warning: variable ‘target’ set but not used [-Wunused-but-set-variable]
>  drivers/net/xen-netfront.c:1592: warning: Function parameter or member 'dev' not described in 'netfront_probe'
>  drivers/net/xen-netfront.c:1592: warning: Function parameter or member 'id' not described in 'netfront_probe'
>  drivers/net/xen-netfront.c:1669: warning: Function parameter or member 'dev' not described in 'netfront_resume'
>  drivers/net/xen-netfront.c:2313: warning: Function parameter or member 'dev' not described in 'netback_changed'
>  drivers/net/xen-netfront.c:2313: warning: Function parameter or member 'backend_state' not described in 'netback_changed'
> 

commit 8ed7ec1386b646130d80d017ecd4716f866ea570
Author: Andrew Lunn <andrew@lunn.ch>
Date:   Sat Oct 31 19:04:35 2020 +0100

    drivers: net: xen-netfront: Fixed W=1 set but unused warnings

Already in net-next.

	Andrew
Andrew Lunn Nov. 4, 2020, 2:38 p.m. UTC | #3
On Wed, Nov 04, 2020 at 02:28:35PM +0000, Lee Jones wrote:
> On Wed, 04 Nov 2020, Andrew Lunn wrote:
> 
> > On Wed, Nov 04, 2020 at 09:06:04AM +0000, Lee Jones wrote:
> > > Fixes the following W=1 kernel build warning(s):
> > > 
> > >  drivers/net/ethernet/ti/am65-cpsw-qos.c:364: warning: Function parameter or member 'ndev' not described in 'am65_cpsw_timer_set'
> > >  drivers/net/ethernet/ti/am65-cpsw-qos.c:364: warning: Function parameter or member 'est_new' not described in 'am65_cpsw_timer_set'
> > > 
> > > Cc: "David S. Miller" <davem@davemloft.net>
> > > Cc: Jakub Kicinski <kuba@kernel.org>
> > > Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> > > Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> > > Cc: netdev@vger.kernel.org
> > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > 
> > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > 
> > I _think_ these have got missed so far in the various cleanup passes
> > because of missing COMPILE_TEST. I've been adding that as part of
> > fixing these warnings. When your respin, could you add that as well?
> 
> Yes, no problem.
> 
> Just for this symbol?

Hi Lee

I've not look at the Kbuild, but ideally so that all TI drivers get
built when COMPILE_TEST is true.

And this probably needs to happen for any patch i added a Reviewed-by:
because i missed them as well. I'm using COMPILE_TEST but just for arm
and x86, where as i guess you are using more randconfig builds, or
less popular architectures?

	Andrew
Andrew Lunn Nov. 4, 2020, 2:45 p.m. UTC | #4
On Wed, Nov 04, 2020 at 02:31:40PM +0000, Lee Jones wrote:
> On Wed, 04 Nov 2020, Andrew Lunn wrote:
> 
> > On Wed, Nov 04, 2020 at 09:06:00AM +0000, Lee Jones wrote:
> > > 'status' is used to interact with a hardware register.  It might not
> > > be safe to remove it entirely.  Mark it as __maybe_unused instead.
> > 
> > Hi Lee
> > 
> > https://www.mail-archive.com/netdev@vger.kernel.org/msg365875.html
> > 
> > I'm working on driver/net/ethernet and net to make it w=1 clean.  I
> > suggest you hang out on the netdev mailing list so you don't waste
> > your time reproducing what i am doing.
> 
> I believe that ship has sailed.  Net should be clean now.

drivers/net is getting better, but is not clean. I have some patches
from Arnd which allow W=1 to be enabled by default for subdirectories,
and i have to skip a few. Also net, not driver/net has problems, which
i'm working on. I hope Arnd will post his patches soon, so we can get
them merged and prevent regressions with W=1.

> Maybe that was down to some of your previous efforts? 

And Jakub running a bot which compile tests all new patches with W=1.

    Andrew
Lee Jones Nov. 4, 2020, 2:56 p.m. UTC | #5
On Wed, 04 Nov 2020, Andrew Lunn wrote:

> On Wed, Nov 04, 2020 at 02:31:40PM +0000, Lee Jones wrote:

> > On Wed, 04 Nov 2020, Andrew Lunn wrote:

> > 

> > > On Wed, Nov 04, 2020 at 09:06:00AM +0000, Lee Jones wrote:

> > > > 'status' is used to interact with a hardware register.  It might not

> > > > be safe to remove it entirely.  Mark it as __maybe_unused instead.

> > > 

> > > Hi Lee

> > > 

> > > https://www.mail-archive.com/netdev@vger.kernel.org/msg365875.html

> > > 

> > > I'm working on driver/net/ethernet and net to make it w=1 clean.  I

> > > suggest you hang out on the netdev mailing list so you don't waste

> > > your time reproducing what i am doing.

> > 

> > I believe that ship has sailed.  Net should be clean now.

> 

> drivers/net is getting better, but is not clean. I have some patches

> from Arnd which allow W=1 to be enabled by default for subdirectories,

> and i have to skip a few. Also net, not driver/net has problems, which

> i'm working on. I hope Arnd will post his patches soon, so we can get

> them merged and prevent regressions with W=1.


That's odd.  I wonder why I'm not seeing any more issues?

> > Maybe that was down to some of your previous efforts? 

> 

> And Jakub running a bot which compile tests all new patches with W=1.


That's great!  My aim is for all maintainers to be doing that.

> No, not really. I'm a networking guy, so will look mostly at

> drivers/net and the core net code.


Duly noted.  I'll leave 'net' alone then.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Lee Jones Nov. 4, 2020, 3:02 p.m. UTC | #6
On Wed, 04 Nov 2020, Andrew Lunn wrote:

> On Wed, Nov 04, 2020 at 02:28:35PM +0000, Lee Jones wrote:
> > On Wed, 04 Nov 2020, Andrew Lunn wrote:
> > 
> > > On Wed, Nov 04, 2020 at 09:06:04AM +0000, Lee Jones wrote:
> > > > Fixes the following W=1 kernel build warning(s):
> > > > 
> > > >  drivers/net/ethernet/ti/am65-cpsw-qos.c:364: warning: Function parameter or member 'ndev' not described in 'am65_cpsw_timer_set'
> > > >  drivers/net/ethernet/ti/am65-cpsw-qos.c:364: warning: Function parameter or member 'est_new' not described in 'am65_cpsw_timer_set'
> > > > 
> > > > Cc: "David S. Miller" <davem@davemloft.net>
> > > > Cc: Jakub Kicinski <kuba@kernel.org>
> > > > Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> > > > Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> > > > Cc: netdev@vger.kernel.org
> > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > 
> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > > 
> > > I _think_ these have got missed so far in the various cleanup passes
> > > because of missing COMPILE_TEST. I've been adding that as part of
> > > fixing these warnings. When your respin, could you add that as well?
> > 
> > Yes, no problem.
> > 
> > Just for this symbol?
> 
> Hi Lee
> 
> I've not look at the Kbuild, but ideally so that all TI drivers get
> built when COMPILE_TEST is true.
> 
> And this probably needs to happen for any patch i added a Reviewed-by:
> because i missed them as well. I'm using COMPILE_TEST but just for arm
> and x86, where as i guess you are using more randconfig builds, or
> less popular architectures?

I'm doing 'allmodconfig' builds for; arm, arm64, mips, ppc and x86.
drt Nov. 4, 2020, 5:59 p.m. UTC | #7
On 2020-11-04 01:06, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  from drivers/net/ethernet/ibm/ibmvnic.c:35:
>  inlined from ‘handle_vpd_rsp’ at 
> drivers/net/ethernet/ibm/ibmvnic.c:4124:3:
>  drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter
> or member 'hdr_data' not described in 'build_hdr_data'
>  drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Excess function
> parameter 'tot_len' description in 'build_hdr_data'
>  drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter
> or member 'hdr_data' not described in 'create_hdr_descs'
>  drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Excess function
> parameter 'data' description in 'create_hdr_descs'
>  drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter
> or member 'txbuff' not described in 'build_hdr_descs_arr'
>  drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Excess function
> parameter 'skb' description in 'build_hdr_descs_arr'
>  drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Excess function
> parameter 'subcrq' description in 'build_hdr_descs_arr'
> 
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Dany Madden <drt@linux.ibm.com>
> Cc: Lijun Pan <ljp@linux.ibm.com>
> Cc: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Santiago Leon <santi_leon@yahoo.com>
> Cc: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
> Cc: John Allen <jallen@linux.vnet.ibm.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Reviewed-by: Dany Madden <drt@linux.ibm.com>

Thanks, Lee.
Dany

> ---
>  drivers/net/ethernet/ibm/ibmvnic.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index b30e1f5784bad..08dab7a94b7ea 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -1360,7 +1360,7 @@ static int ibmvnic_close(struct net_device 
> *netdev)
>   * @hdr_field: bitfield determining needed headers
>   * @skb: socket buffer
>   * @hdr_len: array of header lengths
> - * @tot_len: total length of data
> + * @hdr_data: buffer to write the header to
>   *
>   * Reads hdr_field to determine which headers are needed by firmware.
>   * Builds a buffer containing these headers.  Saves individual header
> @@ -1418,7 +1418,7 @@ static int build_hdr_data(u8 hdr_field, struct
> sk_buff *skb,
>  /**
>   * create_hdr_descs - create header and header extension descriptors
>   * @hdr_field: bitfield determining needed headers
> - * @data: buffer containing header data
> + * @hdr_data: buffer containing header data
>   * @len: length of data buffer
>   * @hdr_len: array of individual header lengths
>   * @scrq_arr: descriptor array
> @@ -1469,9 +1469,8 @@ static int create_hdr_descs(u8 hdr_field, u8
> *hdr_data, int len, int *hdr_len,
> 
>  /**
>   * build_hdr_descs_arr - build a header descriptor array
> - * @skb: socket buffer
> + * @txbuff: tx buffer
>   * @num_entries: number of descriptors to be sent
> - * @subcrq: first TX descriptor
>   * @hdr_field: bit field determining which headers will be sent
>   *
>   * This function will build a TX descriptor array with applicable