2021-01-27 23:52:49

by Lee Jones

[permalink] [raw]
Subject: [PATCH 00/12] Rid W=1 warnings from Thunderbolt

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.

Only 1 small set required for Thunderbolt. Pretty good!

Lee Jones (12):
thunderbolt: dma_port: Remove unused variable 'ret'
thunderbolt: cap: Fix kernel-doc formatting issue
thunderbolt: ctl: Demote non-conformant kernel-doc headers
thunderbolt: eeprom: Demote non-conformant kernel-doc headers to
standard comment blocks
thunderbolt: pa: Demote non-conformant kernel-doc headers
thunderbolt: xdomain: Fix 'tb_unregister_service_driver()'s 'drv'
param
thunderbolt: nhi: Demote some non-conformant kernel-doc headers
thunderbolt: tb: Kernel-doc function headers should document their
parameters
thunderbolt: swit: Demote a bunch of non-conformant kernel-doc headers
thunderbolt: icm: Fix a couple of formatting issues
thunderbolt: tunnel: Fix misspelling of 'receive_path'
thunderbolt: swit: Fix function name in the header

drivers/thunderbolt/cap.c | 2 +-
drivers/thunderbolt/ctl.c | 22 +++++++++++-----------
drivers/thunderbolt/dma_port.c | 5 ++---
drivers/thunderbolt/eeprom.c | 24 ++++++++++++------------
drivers/thunderbolt/icm.c | 4 ++--
drivers/thunderbolt/nhi.c | 14 +++++++-------
drivers/thunderbolt/path.c | 4 ++--
drivers/thunderbolt/switch.c | 14 +++++++-------
drivers/thunderbolt/tb.c | 12 ++++++------
drivers/thunderbolt/tunnel.c | 2 +-
drivers/thunderbolt/xdomain.c | 2 +-
11 files changed, 52 insertions(+), 53 deletions(-)

Cc: Alexei Starovoitov <[email protected]>
Cc: Andreas Noever <[email protected]>
Cc: [email protected]
Cc: Daniel Borkmann <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Jesper Dangaard Brouer <[email protected]>
Cc: John Fastabend <[email protected]>
Cc: [email protected]
Cc: Michael Jamet <[email protected]>
Cc: Mika Westerberg <[email protected]>
Cc: [email protected]
Cc: Yehezkel Bernat <[email protected]>
--
2.25.1


2021-01-27 23:52:50

by Lee Jones

[permalink] [raw]
Subject: [PATCH 10/12] thunderbolt: icm: Fix a couple of formatting issues

Fixes the following W=1 kernel build warning(s):

drivers/thunderbolt/icm.c:122: warning: Function parameter or member 'xdomain_connected' not described in 'icm'
drivers/thunderbolt/icm.c:122: warning: Function parameter or member 'xdomain_disconnected' not described in 'icm'

Cc: Andreas Noever <[email protected]>
Cc: Michael Jamet <[email protected]>
Cc: Mika Westerberg <[email protected]>
Cc: Yehezkel Bernat <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/thunderbolt/icm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index b8c4159bc32d0..09c4a84413ec0 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -85,8 +85,8 @@ struct usb4_switch_nvm_auth {
* @set_uuid: Set UUID for the root switch (optional)
* @device_connected: Handle device connected ICM message
* @device_disconnected: Handle device disconnected ICM message
- * @xdomain_connected - Handle XDomain connected ICM message
- * @xdomain_disconnected - Handle XDomain disconnected ICM message
+ * @xdomain_connected: Handle XDomain connected ICM message
+ * @xdomain_disconnected: Handle XDomain disconnected ICM message
* @rtd3_veto: Handle RTD3 veto notification ICM message
*/
struct icm {
--
2.25.1

2021-01-27 23:52:50

by Lee Jones

[permalink] [raw]
Subject: [PATCH 04/12] thunderbolt: eeprom: Demote non-conformant kernel-doc headers to standard comment blocks

Fixes the following W=1 kernel build warning(s):

drivers/thunderbolt/eeprom.c:19: warning: Function parameter or member 'sw' not described in 'tb_eeprom_ctl_write'
drivers/thunderbolt/eeprom.c:19: warning: Function parameter or member 'ctl' not described in 'tb_eeprom_ctl_write'
drivers/thunderbolt/eeprom.c:27: warning: Function parameter or member 'sw' not described in 'tb_eeprom_ctl_read'
drivers/thunderbolt/eeprom.c:27: warning: Function parameter or member 'ctl' not described in 'tb_eeprom_ctl_read'
drivers/thunderbolt/eeprom.c:27: warning: expecting prototype for tb_eeprom_ctl_write(). Prototype was for tb_eeprom_ctl_read() instead
drivers/thunderbolt/eeprom.c:43: warning: Function parameter or member 'sw' not described in 'tb_eeprom_active'
drivers/thunderbolt/eeprom.c:43: warning: Function parameter or member 'enable' not described in 'tb_eeprom_active'
drivers/thunderbolt/eeprom.c:73: warning: Function parameter or member 'sw' not described in 'tb_eeprom_transfer'
drivers/thunderbolt/eeprom.c:73: warning: Function parameter or member 'ctl' not described in 'tb_eeprom_transfer'
drivers/thunderbolt/eeprom.c:73: warning: Function parameter or member 'direction' not described in 'tb_eeprom_transfer'
drivers/thunderbolt/eeprom.c:97: warning: Function parameter or member 'sw' not described in 'tb_eeprom_out'
drivers/thunderbolt/eeprom.c:97: warning: Function parameter or member 'val' not described in 'tb_eeprom_out'
drivers/thunderbolt/eeprom.c:117: warning: Function parameter or member 'sw' not described in 'tb_eeprom_in'
drivers/thunderbolt/eeprom.c:117: warning: Function parameter or member 'val' not described in 'tb_eeprom_in'
drivers/thunderbolt/eeprom.c:138: warning: Function parameter or member 'sw' not described in 'tb_eeprom_get_drom_offset'
drivers/thunderbolt/eeprom.c:138: warning: Function parameter or member 'offset' not described in 'tb_eeprom_get_drom_offset'
drivers/thunderbolt/eeprom.c:170: warning: Function parameter or member 'sw' not described in 'tb_eeprom_read_n'
drivers/thunderbolt/eeprom.c:170: warning: Function parameter or member 'offset' not described in 'tb_eeprom_read_n'
drivers/thunderbolt/eeprom.c:170: warning: Function parameter or member 'val' not described in 'tb_eeprom_read_n'
drivers/thunderbolt/eeprom.c:170: warning: Function parameter or member 'count' not described in 'tb_eeprom_read_n'
drivers/thunderbolt/eeprom.c:288: warning: Function parameter or member 'sw' not described in 'tb_drom_read_uid_only'
drivers/thunderbolt/eeprom.c:288: warning: Function parameter or member 'uid' not described in 'tb_drom_read_uid_only'
drivers/thunderbolt/eeprom.c:383: warning: Function parameter or member 'sw' not described in 'tb_drom_parse_entries'
drivers/thunderbolt/eeprom.c:417: warning: Function parameter or member 'sw' not described in 'tb_drom_copy_efi'
drivers/thunderbolt/eeprom.c:417: warning: Function parameter or member 'size' not described in 'tb_drom_copy_efi'
drivers/thunderbolt/eeprom.c:526: warning: Function parameter or member 'sw' not described in 'tb_drom_read'

Cc: Andreas Noever <[email protected]>
Cc: Michael Jamet <[email protected]>
Cc: Mika Westerberg <[email protected]>
Cc: Yehezkel Bernat <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/thunderbolt/eeprom.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 0c8471be3e32f..e8cb8399069c9 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -12,7 +12,7 @@
#include <linux/slab.h>
#include "tb.h"

-/**
+/*
* tb_eeprom_ctl_write() - write control word
*/
static int tb_eeprom_ctl_write(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
@@ -20,7 +20,7 @@ static int tb_eeprom_ctl_write(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
return tb_sw_write(sw, ctl, TB_CFG_SWITCH, sw->cap_plug_events + 4, 1);
}

-/**
+/*
* tb_eeprom_ctl_write() - read control word
*/
static int tb_eeprom_ctl_read(struct tb_switch *sw, struct tb_eeprom_ctl *ctl)
@@ -33,7 +33,7 @@ enum tb_eeprom_transfer {
TB_EEPROM_OUT,
};

-/**
+/*
* tb_eeprom_active - enable rom access
*
* WARNING: Always disable access after usage. Otherwise the controller will
@@ -62,7 +62,7 @@ static int tb_eeprom_active(struct tb_switch *sw, bool enable)
}
}

-/**
+/*
* tb_eeprom_transfer - transfer one bit
*
* If TB_EEPROM_IN is passed, then the bit can be retrieved from ctl->data_in.
@@ -90,7 +90,7 @@ static int tb_eeprom_transfer(struct tb_switch *sw, struct tb_eeprom_ctl *ctl,
return tb_eeprom_ctl_write(sw, ctl);
}

-/**
+/*
* tb_eeprom_out - write one byte to the bus
*/
static int tb_eeprom_out(struct tb_switch *sw, u8 val)
@@ -110,7 +110,7 @@ static int tb_eeprom_out(struct tb_switch *sw, u8 val)
return 0;
}

-/**
+/*
* tb_eeprom_in - read one byte from the bus
*/
static int tb_eeprom_in(struct tb_switch *sw, u8 *val)
@@ -131,7 +131,7 @@ static int tb_eeprom_in(struct tb_switch *sw, u8 *val)
return 0;
}

-/**
+/*
* tb_eeprom_get_drom_offset - get drom offset within eeprom
*/
static int tb_eeprom_get_drom_offset(struct tb_switch *sw, u16 *offset)
@@ -162,7 +162,7 @@ static int tb_eeprom_get_drom_offset(struct tb_switch *sw, u16 *offset)
return 0;
}

-/**
+/*
* tb_eeprom_read_n - read count bytes from offset into val
*/
static int tb_eeprom_read_n(struct tb_switch *sw, u16 offset, u8 *val,
@@ -278,7 +278,7 @@ struct tb_drom_entry_port {
} __packed;


-/**
+/*
* tb_drom_read_uid_only - read uid directly from drom
*
* Does not use the cached copy in sw->drom. Used during resume to check switch
@@ -374,7 +374,7 @@ static int tb_drom_parse_entry_port(struct tb_switch *sw,
return 0;
}

-/**
+/*
* tb_drom_parse_entries - parse the linked list of drom entries
*
* Drom must have been copied to sw->drom.
@@ -410,7 +410,7 @@ static int tb_drom_parse_entries(struct tb_switch *sw)
return 0;
}

-/**
+/*
* tb_drom_copy_efi - copy drom supplied by EFI to sw->drom if present
*/
static int tb_drom_copy_efi(struct tb_switch *sw, u16 *size)
@@ -519,7 +519,7 @@ static int tb_drom_read_n(struct tb_switch *sw, u16 offset, u8 *val,
return tb_eeprom_read_n(sw, offset, val, count);
}

-/**
+/*
* tb_drom_read - copy drom to sw->drom and parse it
*/
int tb_drom_read(struct tb_switch *sw)
--
2.25.1

2021-01-27 23:53:27

by Lee Jones

[permalink] [raw]
Subject: [PATCH 12/12] thunderbolt: swit: Fix function name in the header

Fixes the following W=1 kernel build warning(s):

drivers/thunderbolt/switch.c:1322: warning: expecting prototype for reset_switch(). Prototype was for tb_switch_reset() instead

Cc: Andreas Noever <[email protected]>
Cc: Michael Jamet <[email protected]>
Cc: Mika Westerberg <[email protected]>
Cc: Yehezkel Bernat <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/thunderbolt/switch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index ce1b120d1cd46..6a3d5608431f6 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1313,7 +1313,7 @@ static void tb_dump_switch(const struct tb *tb, const struct tb_switch *sw)
}

/**
- * reset_switch() - reconfigure route, enable and send TB_CFG_PKG_RESET
+ * tb_switch_reset() - reconfigure route, enable and send TB_CFG_PKG_RESET
* @sw: Switch to reset
*
* Return: Returns 0 on success or an error code on failure.
--
2.25.1

2021-01-27 23:53:33

by Lee Jones

[permalink] [raw]
Subject: [PATCH 09/12] thunderbolt: swit: Demote a bunch of non-conformant kernel-doc headers

Fixes the following W=1 kernel build warning(s):

drivers/thunderbolt/switch.c:540: warning: Function parameter or member 'port' not described in 'tb_wait_for_port'
drivers/thunderbolt/switch.c:540: warning: Function parameter or member 'wait_if_unplugged' not described in 'tb_wait_for_port'
drivers/thunderbolt/switch.c:599: warning: Function parameter or member 'port' not described in 'tb_port_add_nfc_credits'
drivers/thunderbolt/switch.c:599: warning: Function parameter or member 'credits' not described in 'tb_port_add_nfc_credits'
drivers/thunderbolt/switch.c:653: warning: Function parameter or member 'port' not described in 'tb_port_clear_counter'
drivers/thunderbolt/switch.c:653: warning: Function parameter or member 'counter' not described in 'tb_port_clear_counter'
drivers/thunderbolt/switch.c:730: warning: Function parameter or member 'port' not described in 'tb_init_port'
drivers/thunderbolt/switch.c:1348: warning: Function parameter or member 'sw' not described in 'tb_plug_events_active'
drivers/thunderbolt/switch.c:1348: warning: Function parameter or member 'active' not described in 'tb_plug_events_active'
drivers/thunderbolt/switch.c:2654: warning: Function parameter or member 'sw' not described in 'tb_sw_set_unplugged'

Cc: Andreas Noever <[email protected]>
Cc: Michael Jamet <[email protected]>
Cc: Mika Westerberg <[email protected]>
Cc: Yehezkel Bernat <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/thunderbolt/switch.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index cdba05e72486b..ce1b120d1cd46 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -523,7 +523,7 @@ int tb_port_state(struct tb_port *port)
return phy.state;
}

-/**
+/*
* tb_wait_for_port() - wait for a port to become ready
*
* Wait up to 1 second for a port to reach state TB_PORT_UP. If
@@ -587,7 +587,7 @@ int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged)
return 0;
}

-/**
+/*
* tb_port_add_nfc_credits() - add/remove non flow controlled credits to port
*
* Change the number of NFC credits allocated to @port by @credits. To remove
@@ -644,7 +644,7 @@ int tb_port_set_initial_credits(struct tb_port *port, u32 credits)
return tb_port_write(port, &data, TB_CFG_PORT, ADP_CS_5, 1);
}

-/**
+/*
* tb_port_clear_counter() - clear a counter in TB_CFG_COUNTER
*
* Return: Returns 0 on success or an error code on failure.
@@ -718,7 +718,7 @@ int tb_port_disable(struct tb_port *port)
return __tb_port_enable(port, false);
}

-/**
+/*
* tb_init_port() - initialize a port
*
* This is a helper method for tb_switch_alloc. Does not check or initialize
@@ -1337,7 +1337,7 @@ int tb_switch_reset(struct tb_switch *sw)
return res.err;
}

-/**
+/*
* tb_plug_events_active() - enable/disable plug events on a switch
*
* Also configures a sane plug_events_delay of 255ms.
@@ -2647,7 +2647,7 @@ void tb_switch_remove(struct tb_switch *sw)
device_unregister(&sw->dev);
}

-/**
+/*
* tb_sw_set_unplugged() - set is_unplugged on switch and downstream switches
*/
void tb_sw_set_unplugged(struct tb_switch *sw)
--
2.25.1

2021-01-28 11:12:12

by Mika Westerberg

[permalink] [raw]
Subject: Re: [PATCH 00/12] Rid W=1 warnings from Thunderbolt

Hi Lee,

On Wed, Jan 27, 2021 at 11:25:42AM +0000, Lee Jones wrote:
> 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.
>
> Only 1 small set required for Thunderbolt. Pretty good!
>
> Lee Jones (12):
> thunderbolt: dma_port: Remove unused variable 'ret'
> thunderbolt: cap: Fix kernel-doc formatting issue
> thunderbolt: ctl: Demote non-conformant kernel-doc headers
> thunderbolt: eeprom: Demote non-conformant kernel-doc headers to
> standard comment blocks
> thunderbolt: pa: Demote non-conformant kernel-doc headers
> thunderbolt: xdomain: Fix 'tb_unregister_service_driver()'s 'drv'
> param
> thunderbolt: nhi: Demote some non-conformant kernel-doc headers
> thunderbolt: tb: Kernel-doc function headers should document their
> parameters
> thunderbolt: swit: Demote a bunch of non-conformant kernel-doc headers
> thunderbolt: icm: Fix a couple of formatting issues
> thunderbolt: tunnel: Fix misspelling of 'receive_path'
> thunderbolt: swit: Fix function name in the header

I applied all of the changes that touch static functions. For non-static
functions I will send a patch set shortly that adds the missing bits for
the kernel-doc descriptions. I also fixed $subject lines of few patches
("switch:" instead of "swit:").

Please check that I got everything correct in

git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git next

Thanks!

2021-01-28 13:20:31

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 00/12] Rid W=1 warnings from Thunderbolt

On Thu, 28 Jan 2021, Mika Westerberg wrote:

> Hi Lee,
>
> On Wed, Jan 27, 2021 at 11:25:42AM +0000, Lee Jones wrote:
> > 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.
> >
> > Only 1 small set required for Thunderbolt. Pretty good!
> >
> > Lee Jones (12):
> > thunderbolt: dma_port: Remove unused variable 'ret'
> > thunderbolt: cap: Fix kernel-doc formatting issue
> > thunderbolt: ctl: Demote non-conformant kernel-doc headers
> > thunderbolt: eeprom: Demote non-conformant kernel-doc headers to
> > standard comment blocks
> > thunderbolt: pa: Demote non-conformant kernel-doc headers
> > thunderbolt: xdomain: Fix 'tb_unregister_service_driver()'s 'drv'
> > param
> > thunderbolt: nhi: Demote some non-conformant kernel-doc headers
> > thunderbolt: tb: Kernel-doc function headers should document their
> > parameters
> > thunderbolt: swit: Demote a bunch of non-conformant kernel-doc headers
> > thunderbolt: icm: Fix a couple of formatting issues
> > thunderbolt: tunnel: Fix misspelling of 'receive_path'
> > thunderbolt: swit: Fix function name in the header
>
> I applied all of the changes that touch static functions. For non-static
> functions I will send a patch set shortly that adds the missing bits for
> the kernel-doc descriptions. I also fixed $subject lines of few patches
> ("switch:" instead of "swit:").

Oh, that's odd. This must be a bug in my script.

As I strip [ch], as in *.c and *.h.

Thanks for noticing.

> Please check that I got everything correct in
>
> git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git next
>
> Thanks!

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog