2020-11-04 19:38:02

by Lee Jones

[permalink] [raw]
Subject: [PATCH 00/36] Rid W=1 issues from TTY

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.

Lee Jones (36):
tty: serdev: core: Remove unused variable 'dummy'
tty: serdev: core: Provide missing description for 'owner'
tty: tty_baudrate: Add missing description for 'tty'
tty: tty_io: Move 'tty_sysctl_init's prototype to shared space
tty: tty_buffer: Add missing description for 'limit'
tty: tty_port: Demote obvious abuse of kernel-doc formatting
tty: tty_jobctrl: Add missing function parameter descriptions
tty: tty_ldisc: Fix some kernel-doc related misdemeanours
tty: vt: consolemap: Demote weakly documented function header
tty: n_tty: Add 2 missing parameter descriptions
tty: serial: jsm: jsm_cls: Remove unused variable 'discard'
tty: tty_io: Fix some kernel-doc issues
tty: serial: 8250: 8250_port: Staticify functions referenced by
pointers
tty: serial: 8250: serial_cs: Remove unused/unchecked variable 'err'
tty: tty_audit: Demote non-conformant kernel-doc headers
tty: pty: Provide descriptions for the 'file' parameters
tty: serial: amba-pl011: Mark 'sbsa_uart_acpi_match' as __maybe_unused
tty: n_gsm: Demote obvious abuse of kernel-doc and supply other
missing docss
tty: serial: lpc32xx_hs: Remove unused variable 'tmp'
tty: serial: msm_serial: Remove set but unused variable 'status'
tty: serial: ifx6x60: Fix function documentation headers
tty: serial: xilinx_uartps: Supply description for missing member
'cts_override'
tty: synclink_gt: Demote one kernel-doc header and repair another
tty: serial: serial-tegra: Struct headers should start with 'struct
<name>'
tty: serial: sifive: Struct headers should start with 'struct <name>'
tty: synclinkmp: Add missing description for function param 'txqueue'
tty: synclinkmp: Mark never checked 'readval' as __always_unused
tty: serial: stm32-usart: Remove set but unused 'cookie' variables
tty: tty_ldisc: Supply missing description for 'tty_ldisc_get's 'tty'
param
tty: serial: serial-tegra: Provide some missing struct member
descriptions
powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to
shared location
tty: hvc: hvc_vio: Staticify function invoked only by reference
tty: hvc: hvc_opal: Staticify function invoked by reference
tty: serial: pmac_zilog: Make disposable variable __always_unused
tty: synclink: Mark disposable variables as __always_unused
tty: synclink: Provide missing description for 'hdlcdev_tx_timeout's
'txqueue' param

arch/powerpc/include/asm/hvconsole.h | 3 +++
arch/powerpc/platforms/pseries/pseries.h | 3 ---
arch/powerpc/platforms/pseries/setup.c | 1 +
drivers/tty/hvc/hvc_opal.c | 2 +-
drivers/tty/hvc/hvc_vio.c | 2 +-
drivers/tty/n_gsm.c | 4 +++-
drivers/tty/n_tty.c | 2 ++
drivers/tty/pty.c | 2 ++
drivers/tty/serdev/core.c | 6 ++----
drivers/tty/serial/8250/8250_port.c | 4 ++--
drivers/tty/serial/8250/serial_cs.c | 9 +++------
drivers/tty/serial/amba-pl011.c | 2 +-
drivers/tty/serial/ifx6x60.c | 3 ++-
drivers/tty/serial/jsm/jsm_cls.c | 4 +---
drivers/tty/serial/lpc32xx_hs.c | 3 +--
drivers/tty/serial/msm_serial.c | 3 +--
drivers/tty/serial/pmac_zilog.h | 2 +-
drivers/tty/serial/serial-tegra.c | 7 ++++++-
drivers/tty/serial/sifive.c | 3 ++-
drivers/tty/serial/stm32-usart.c | 6 ++----
drivers/tty/serial/xilinx_uartps.c | 1 +
drivers/tty/synclink.c | 5 +++--
drivers/tty/synclink_gt.c | 3 ++-
drivers/tty/synclinkmp.c | 3 ++-
drivers/tty/tty_audit.c | 12 ++++++------
drivers/tty/tty_baudrate.c | 1 +
drivers/tty/tty_buffer.c | 1 +
drivers/tty/tty_io.c | 12 +++++++-----
drivers/tty/tty_jobctrl.c | 3 +++
drivers/tty/tty_ldisc.c | 11 ++++++-----
drivers/tty/tty_port.c | 4 ++--
drivers/tty/vt/consolemap.c | 3 +--
include/linux/tty.h | 1 +
33 files changed, 73 insertions(+), 58 deletions(-)

Cc: Alexandre Torgue <[email protected]>
Cc: "Andrew J. Kroll" <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andy Gross <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Bill Hawes <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: Colin Ian King <[email protected]>
Cc: "C. Scott Ananian" <[email protected]>
Cc: "David A. Hinds" <[email protected]>
Cc: [email protected]
Cc: Filip Aben <[email protected]>
Cc: Gerald Baeza <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jakub Jelinek <[email protected]>
Cc: Jan Dumon <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Joseph Barrow <[email protected]>
Cc: -- <[email protected]>
Cc: Kevin Wells <[email protected]>
Cc: Laxman Dewangan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Marko Kohtala <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Mike Hudson <[email protected]>
Cc: Miloslav Trmac <[email protected]>
Cc: Nick Holloway <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: [email protected]
Cc: Paul Mackerras <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: processes-Sapan Bhatia <[email protected]>
Cc: Robert Love <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Roland Stigge <[email protected]>
Cc: Russell King <[email protected]>
Cc: Russell King <[email protected]>
Cc: Russ Gorby <[email protected]>
Cc: Stanislav Voronyi <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Sylvain Lemieux <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Vladimir Zapolskiy <[email protected]>
--
2.25.1


2020-11-04 19:38:14

by Lee Jones

[permalink] [raw]
Subject: [PATCH 03/36] tty: tty_baudrate: Add missing description for 'tty'

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

drivers/tty/tty_baudrate.c:234: warning: Function parameter or member 'tty' not described in 'tty_encode_baud_rate'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_baudrate.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c
index 84fec3c62d6a4..6551b188b736b 100644
--- a/drivers/tty/tty_baudrate.c
+++ b/drivers/tty/tty_baudrate.c
@@ -222,6 +222,7 @@ EXPORT_SYMBOL_GPL(tty_termios_encode_baud_rate);

/**
* tty_encode_baud_rate - set baud rate of the tty
+ * @tty: terminal device
* @ibaud: input baud rate
* @obaud: output baud rate
*
--
2.25.1

2020-11-04 19:38:33

by Lee Jones

[permalink] [raw]
Subject: [PATCH 15/36] tty: tty_audit: Demote non-conformant kernel-doc headers

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

drivers/tty/tty_audit.c:91: warning: Function parameter or member 'buf' not described in 'tty_audit_buf_push'
drivers/tty/tty_audit.c:129: warning: Function parameter or member 'sig' not described in 'tty_audit_fork'
drivers/tty/tty_audit.c:137: warning: Function parameter or member 'tty' not described in 'tty_audit_tiocsti'
drivers/tty/tty_audit.c:137: warning: Function parameter or member 'ch' not described in 'tty_audit_tiocsti'
drivers/tty/tty_audit.c:202: warning: Function parameter or member 'tty' not described in 'tty_audit_add_data'
drivers/tty/tty_audit.c:202: warning: Function parameter or member 'data' not described in 'tty_audit_add_data'
drivers/tty/tty_audit.c:202: warning: Function parameter or member 'size' not described in 'tty_audit_add_data'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Miloslav Trmac <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_audit.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index 9f906a5b8e810..32898aabcd068 100644
--- a/drivers/tty/tty_audit.c
+++ b/drivers/tty/tty_audit.c
@@ -81,7 +81,7 @@ static void tty_audit_log(const char *description, dev_t dev,
}
}

-/**
+/*
* tty_audit_buf_push - Push buffered data out
*
* Generate an audit message from the contents of @buf, which is owned by
@@ -120,7 +120,7 @@ void tty_audit_exit(void)
tty_audit_buf_free(buf);
}

-/**
+/*
* tty_audit_fork - Copy TTY audit state for a new task
*
* Set up TTY audit state in @sig from current. @sig needs no locking.
@@ -130,7 +130,7 @@ void tty_audit_fork(struct signal_struct *sig)
sig->audit_tty = current->signal->audit_tty;
}

-/**
+/*
* tty_audit_tiocsti - Log TIOCSTI
*/
void tty_audit_tiocsti(struct tty_struct *tty, char ch)
@@ -145,7 +145,7 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch)
tty_audit_log("ioctl=TIOCSTI", dev, &ch, 1);
}

-/**
+/*
* tty_audit_push - Flush current's pending audit data
*
* Returns 0 if success, -EPERM if tty audit is disabled
@@ -166,7 +166,7 @@ int tty_audit_push(void)
return 0;
}

-/**
+/*
* tty_audit_buf_get - Get an audit buffer.
*
* Get an audit buffer, allocate it if necessary. Return %NULL
@@ -193,7 +193,7 @@ static struct tty_audit_buf *tty_audit_buf_get(void)
return tty_audit_buf_ref();
}

-/**
+/*
* tty_audit_add_data - Add data for TTY auditing.
*
* Audit @data of @size from @tty, if necessary.
--
2.25.1

2020-11-04 19:38:40

by Lee Jones

[permalink] [raw]
Subject: [PATCH 14/36] tty: serial: 8250: serial_cs: Remove unused/unchecked variable 'err'

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

drivers/tty/serial/8250/serial_cs.c: In function ‘multi_config’:
drivers/tty/serial/8250/serial_cs.c:562:7: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Colin Ian King <[email protected]>
Cc: "David A. Hinds" <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/8250/serial_cs.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index e3d10794dbba3..35ff6627c61be 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -559,16 +559,13 @@ static int multi_config(struct pcmcia_device *link)
*/
if (info->manfid == MANFID_OXSEMI || (info->manfid == MANFID_POSSIO &&
info->prodid == PRODID_POSSIO_GCC)) {
- int err;
-
if (link->config_index == 1 ||
link->config_index == 3) {
- err = setup_serial(link, info, base2,
- link->irq);
+ setup_serial(link, info, base2, link->irq);
base2 = link->resource[0]->start;
} else {
- err = setup_serial(link, info, link->resource[0]->start,
- link->irq);
+ setup_serial(link, info, link->resource[0]->start,
+ link->irq);
}
info->c950ctrl = base2;

--
2.25.1

2020-11-04 19:38:49

by Lee Jones

[permalink] [raw]
Subject: [PATCH 24/36] tty: serial: serial-tegra: Struct headers should start with 'struct <name>'

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

drivers/tty/serial/serial-tegra.c:85: warning: cannot understand function prototype: 'struct tegra_uart_chip_data '

Cc: Laxman Dewangan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/serial-tegra.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index bd13014a1c537..c363ee0470f45 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -75,7 +75,7 @@
#define TEGRA_UART_FCR_IIR_FIFO_EN 0x40

/**
- * tegra_uart_chip_data: SOC specific data.
+ * struct tegra_uart_chip_data: SOC specific data.
*
* @tx_fifo_full_status: Status flag available for checking tx fifo full.
* @allow_txfifo_reset_fifo_mode: allow_tx fifo reset with fifo mode or not.
--
2.25.1

2020-11-04 19:39:08

by Lee Jones

[permalink] [raw]
Subject: [PATCH 29/36] tty: tty_ldisc: Supply missing description for 'tty_ldisc_get's 'tty' param

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

drivers/tty/tty_ldisc.c:160: warning: Function parameter or member 'tty' not described in 'tty_ldisc_get'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_ldisc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index aced2bf6173be..1ba74d6f5e5cd 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -138,6 +138,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
static int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD);
/**
* tty_ldisc_get - take a reference to an ldisc
+ * @tty: tty device
* @disc: ldisc number
*
* Takes a reference to a line discipline. Deals with refcounts and
--
2.25.1

2020-11-04 19:39:14

by Lee Jones

[permalink] [raw]
Subject: [PATCH 36/36] tty: synclink: Provide missing description for 'hdlcdev_tx_timeout's 'txqueue' param

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

drivers/tty/synclink.c:7708: warning: Function parameter or member 'txqueue' not described in 'hdlcdev_tx_timeout'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/synclink.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 8ed64b1e7c378..cbe9ad0683fc9 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -7703,6 +7703,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
* hdlcdev_tx_timeout - called by network layer when transmit timeout is detected
*
* @dev: pointer to network device structure
+ * @txqueue: unused
*/
static void hdlcdev_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
--
2.25.1

2020-11-04 19:39:17

by Lee Jones

[permalink] [raw]
Subject: [PATCH 35/36] tty: synclink: Mark disposable variables as __always_unused

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

drivers/tty/synclink.c: In function ‘usc_reset’:
drivers/tty/synclink.c:5571:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]
drivers/tty/synclink.c: In function ‘mgsl_load_pci_memory’:
drivers/tty/synclink.c:7267:16: warning: variable ‘Dummy’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/synclink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index c8324d58ef564..8ed64b1e7c378 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -5568,7 +5568,7 @@ static void usc_load_txfifo( struct mgsl_struct *info )
static void usc_reset( struct mgsl_struct *info )
{
int i;
- u32 readval;
+ u32 __always_unused readval;

/* Set BIT30 of Misc Control Register */
/* (Local Control Register 0x50) to force reset of USC. */
@@ -7264,7 +7264,7 @@ static void mgsl_load_pci_memory( char* TargetPtr, const char* SourcePtr,

unsigned short Intervalcount = count / PCI_LOAD_INTERVAL;
unsigned short Index;
- unsigned long Dummy;
+ unsigned long __always_unused Dummy;

for ( Index = 0 ; Index < Intervalcount ; Index++ )
{
--
2.25.1

2020-11-04 19:39:18

by Lee Jones

[permalink] [raw]
Subject: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable __always_unused

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

drivers/tty/serial/pmac_zilog.h:365:58: warning: variable ‘garbage’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/pmac_zilog.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/pmac_zilog.h b/drivers/tty/serial/pmac_zilog.h
index bb874e76810e0..968aec7c1cf82 100644
--- a/drivers/tty/serial/pmac_zilog.h
+++ b/drivers/tty/serial/pmac_zilog.h
@@ -362,7 +362,7 @@ static inline void zssync(struct uart_pmac_port *port)

/* Misc macros */
#define ZS_CLEARERR(port) (write_zsreg(port, 0, ERR_RES))
-#define ZS_CLEARFIFO(port) do { volatile unsigned char garbage; \
+#define ZS_CLEARFIFO(port) do { volatile unsigned char __always_unused garbage; \
garbage = read_zsdata(port); \
garbage = read_zsdata(port); \
garbage = read_zsdata(port); \
--
2.25.1

2020-11-04 19:39:30

by Lee Jones

[permalink] [raw]
Subject: [PATCH 11/36] tty: serial: jsm: jsm_cls: Remove unused variable 'discard'

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

drivers/tty/serial/jsm/jsm_cls.c: In function ‘cls_copy_data_from_uart_to_queue’:
drivers/tty/serial/jsm/jsm_cls.c:400:7: warning: variable ‘discard’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/jsm/jsm_cls.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_cls.c b/drivers/tty/serial/jsm/jsm_cls.c
index c061a7b7bd233..b507a2cec9269 100644
--- a/drivers/tty/serial/jsm/jsm_cls.c
+++ b/drivers/tty/serial/jsm/jsm_cls.c
@@ -397,10 +397,8 @@ static void cls_copy_data_from_uart_to_queue(struct jsm_channel *ch)
* which in this case is the break signal.
*/
if (linestatus & error_mask) {
- u8 discard;
-
linestatus = 0;
- discard = readb(&ch->ch_cls_uart->txrx);
+ readb(&ch->ch_cls_uart->txrx);
continue;
}

--
2.25.1

2020-11-04 19:39:44

by Lee Jones

[permalink] [raw]
Subject: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

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

drivers/tty/synclinkmp.c: In function ‘init_adapter’:
drivers/tty/synclinkmp.c:5167:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/synclinkmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index 0ca738f61a35b..75f494bfdcbed 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -5165,7 +5165,7 @@ static bool init_adapter(SLMP_INFO *info)

/* Set BIT30 of Local Control Reg 0x50 to reset SCA */
volatile u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50);
- u32 readval;
+ u32 __always_unused readval;

info->misc_ctrl_value |= BIT30;
*MiscCtrl = info->misc_ctrl_value;
--
2.25.1

2020-11-04 19:39:56

by Lee Jones

[permalink] [raw]
Subject: [PATCH 31/36] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location

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

drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
385 | void __init hvc_vio_init_early(void)
| ^~~~~~~~~~~~~~~~~~

Cc: Michael Ellerman <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
arch/powerpc/include/asm/hvconsole.h | 3 +++
arch/powerpc/platforms/pseries/pseries.h | 3 ---
arch/powerpc/platforms/pseries/setup.c | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/hvconsole.h b/arch/powerpc/include/asm/hvconsole.h
index 999ed5ac90531..936a1ee1ac786 100644
--- a/arch/powerpc/include/asm/hvconsole.h
+++ b/arch/powerpc/include/asm/hvconsole.h
@@ -24,5 +24,8 @@
extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);

+/* Provided by HVC VIO */
+extern void hvc_vio_init_early(void);
+
#endif /* __KERNEL__ */
#endif /* _PPC64_HVCONSOLE_H */
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 13fa370a87e4e..7be5b054dfc36 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -43,9 +43,6 @@ extern void pSeries_final_fixup(void);
/* Poweron flag used for enabling auto ups restart */
extern unsigned long rtas_poweron_auto;

-/* Provided by HVC VIO */
-extern void hvc_vio_init_early(void);
-
/* Dynamic logical Partitioning/Mobility */
extern void dlpar_free_cc_nodes(struct device_node *);
extern void dlpar_free_cc_property(struct property *);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 633c45ec406da..6999b83f06612 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -71,6 +71,7 @@
#include <asm/swiotlb.h>
#include <asm/svm.h>
#include <asm/dtl.h>
+#include <asm/hvconsole.h>

#include "pseries.h"
#include "../../../../drivers/pci/pci.h"
--
2.25.1

2020-11-04 19:40:01

by Lee Jones

[permalink] [raw]
Subject: [PATCH 16/36] tty: pty: Provide descriptions for the 'file' parameters

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

drivers/tty/pty.c:710: warning: Function parameter or member 'file' not described in 'ptm_unix98_lookup'
drivers/tty/pty.c:726: warning: Function parameter or member 'file' not described in 'pts_unix98_lookup'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: "C. Scott Ananian" <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/pty.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 23368cec7ee84..a59f1e062bc65 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -699,6 +699,7 @@ static long pty_unix98_compat_ioctl(struct tty_struct *tty,
/**
* ptm_unix98_lookup - find a pty master
* @driver: ptm driver
+ * @file: unused
* @idx: tty index
*
* Look up a pty master device. Called under the tty_mutex for now.
@@ -715,6 +716,7 @@ static struct tty_struct *ptm_unix98_lookup(struct tty_driver *driver,
/**
* pts_unix98_lookup - find a pty slave
* @driver: pts driver
+ * @file: file pointer to tty
* @idx: tty index
*
* Look up a pty master device. Called under the tty_mutex for now.
--
2.25.1

2020-11-04 19:40:01

by Lee Jones

[permalink] [raw]
Subject: [PATCH 28/36] tty: serial: stm32-usart: Remove set but unused 'cookie' variables

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

drivers/tty/serial/stm32-usart.c: In function ‘stm32_transmit_chars_dma’:
drivers/tty/serial/stm32-usart.c:353:15: warning: variable ‘cookie’ set but not used [-Wunused-but-set-variable]
drivers/tty/serial/stm32-usart.c: In function ‘stm32_of_dma_rx_probe’:
drivers/tty/serial/stm32-usart.c:1090:15: warning: variable ‘cookie’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Gerald Baeza <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/stm32-usart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index ee6c7762d3559..f4de32d3f2afe 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -350,7 +350,6 @@ static void stm32_transmit_chars_dma(struct uart_port *port)
struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
struct circ_buf *xmit = &port->state->xmit;
struct dma_async_tx_descriptor *desc = NULL;
- dma_cookie_t cookie;
unsigned int count, i;

if (stm32port->tx_dma_busy)
@@ -394,7 +393,7 @@ static void stm32_transmit_chars_dma(struct uart_port *port)
desc->callback_param = port;

/* Push current DMA TX transaction in the pending queue */
- cookie = dmaengine_submit(desc);
+ dmaengine_submit(desc);

/* Issue pending DMA TX requests */
dma_async_issue_pending(stm32port->tx_ch);
@@ -1087,7 +1086,6 @@ static int stm32_of_dma_rx_probe(struct stm32_port *stm32port,
struct device *dev = &pdev->dev;
struct dma_slave_config config;
struct dma_async_tx_descriptor *desc = NULL;
- dma_cookie_t cookie;
int ret;

/* Request DMA RX channel */
@@ -1132,7 +1130,7 @@ static int stm32_of_dma_rx_probe(struct stm32_port *stm32port,
desc->callback_param = NULL;

/* Push current DMA transaction in the pending queue */
- cookie = dmaengine_submit(desc);
+ dmaengine_submit(desc);

/* Issue pending DMA requests */
dma_async_issue_pending(stm32port->rx_ch);
--
2.25.1

2020-11-04 19:40:03

by Lee Jones

[permalink] [raw]
Subject: [PATCH 02/36] tty: serdev: core: Provide missing description for 'owner'

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

drivers/tty/serdev/core.c: In function ‘serdev_controller_remove’:
drivers/tty/serdev/core.c:811: warning: Function parameter or member 'owner' not described in '__serdev_device_driver_register'

Cc: Rob Herring <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serdev/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index fecc28a73b3b2..aead0c0c97966 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -800,6 +800,7 @@ EXPORT_SYMBOL_GPL(serdev_controller_remove);
/**
* serdev_driver_register() - Register client driver with serdev core
* @sdrv: client driver to be associated with client-device.
+ * @owner: client driver owner to set.
*
* This API will register the client driver with the serdev framework.
* It is typically called from the driver's module-init function.
--
2.25.1

2020-11-04 19:40:14

by Lee Jones

[permalink] [raw]
Subject: [PATCH 19/36] tty: serial: lpc32xx_hs: Remove unused variable 'tmp'

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

drivers/tty/serial/lpc32xx_hs.c: In function ‘__serial_uart_flush’:
drivers/tty/serial/lpc32xx_hs.c:244:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Vladimir Zapolskiy <[email protected]>
Cc: Sylvain Lemieux <[email protected]>
Cc: Kevin Wells <[email protected]>
Cc: Roland Stigge <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/lpc32xx_hs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index b5898c9320361..1fa098d7aec4b 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -241,12 +241,11 @@ static unsigned int __serial_get_clock_div(unsigned long uartclk,

static void __serial_uart_flush(struct uart_port *port)
{
- u32 tmp;
int cnt = 0;

while ((readl(LPC32XX_HSUART_LEVEL(port->membase)) > 0) &&
(cnt++ < FIFO_READ_LIMIT))
- tmp = readl(LPC32XX_HSUART_FIFO(port->membase));
+ readl(LPC32XX_HSUART_FIFO(port->membase));
}

static void __serial_lpc32xx_rx(struct uart_port *port)
--
2.25.1

2020-11-04 19:40:43

by Lee Jones

[permalink] [raw]
Subject: [PATCH 17/36] tty: serial: amba-pl011: Mark 'sbsa_uart_acpi_match' as __maybe_unused

When !ACPI 'sbsa_uart_acpi_match' is not referenced.

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

drivers/tty/serial/amba-pl011.c:2792:36: warning: ‘sbsa_uart_acpi_match’ defined but not used [-Wunused-const-variable=]

Cc: Russell King <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/amba-pl011.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 87dc3fc15694a..c255476cce287 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2789,7 +2789,7 @@ static const struct of_device_id sbsa_uart_of_match[] = {
};
MODULE_DEVICE_TABLE(of, sbsa_uart_of_match);

-static const struct acpi_device_id sbsa_uart_acpi_match[] = {
+static const struct acpi_device_id __maybe_unused sbsa_uart_acpi_match[] = {
{ "ARMH0011", 0 },
{},
};
--
2.25.1

2020-11-04 19:40:53

by Lee Jones

[permalink] [raw]
Subject: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

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

drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Mike Hudson <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/8250/8250_port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index b0af13074cd36..ebce4406dc289 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -346,7 +346,7 @@ static const s8 au_io_out_map[8] = {
-1, /* UART_SCR (unmapped) */
};

-unsigned int au_serial_in(struct uart_port *p, int offset)
+static unsigned int au_serial_in(struct uart_port *p, int offset)
{
if (offset >= ARRAY_SIZE(au_io_in_map))
return UINT_MAX;
@@ -356,7 +356,7 @@ unsigned int au_serial_in(struct uart_port *p, int offset)
return __raw_readl(p->membase + (offset << p->regshift));
}

-void au_serial_out(struct uart_port *p, int offset, int value)
+static void au_serial_out(struct uart_port *p, int offset, int value)
{
if (offset >= ARRAY_SIZE(au_io_out_map))
return;
--
2.25.1

2020-11-04 19:41:03

by Lee Jones

[permalink] [raw]
Subject: [PATCH 12/36] tty: tty_io: Fix some kernel-doc issues

Demote non-conformant headers and supply some missing descriptions.

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

drivers/tty/tty_io.c:218: warning: Function parameter or member 'file' not described in 'tty_free_file'
drivers/tty/tty_io.c:566: warning: Function parameter or member 'exit_session' not described in '__tty_hangup'
drivers/tty/tty_io.c:1077: warning: Function parameter or member 'tty' not described in 'tty_send_xchar'
drivers/tty/tty_io.c:1077: warning: Function parameter or member 'ch' not described in 'tty_send_xchar'
drivers/tty/tty_io.c:1155: warning: Function parameter or member 'file' not described in 'tty_driver_lookup_tty'
drivers/tty/tty_io.c:1508: warning: Function parameter or member 'tty' not described in 'release_tty'
drivers/tty/tty_io.c:1508: warning: Function parameter or member 'idx' not described in 'release_tty'
drivers/tty/tty_io.c:2973: warning: Function parameter or member 'driver' not described in 'alloc_tty_struct'
drivers/tty/tty_io.c:2973: warning: Function parameter or member 'idx' not described in 'alloc_tty_struct'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Nick Holloway <[email protected]>
Cc: -- <[email protected]>
Cc: Marko Kohtala <[email protected]>
Cc: Bill Hawes <[email protected]>
Cc: "C. Scott Ananian" <[email protected]>
Cc: Russell King <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_io.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 88b00c47b606e..f50286fb080da 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -208,7 +208,7 @@ void tty_add_file(struct tty_struct *tty, struct file *file)
spin_unlock(&tty->files_lock);
}

-/**
+/*
* tty_free_file - free file->private_data
*
* This shall be used only for fail path handling when tty_add_file was not
@@ -543,6 +543,7 @@ EXPORT_SYMBOL_GPL(tty_wakeup);
/**
* __tty_hangup - actual handler for hangup events
* @tty: tty device
+ * @exit_session: if non-zero, signal all foreground group processes
*
* This can be called by a "kworker" kernel thread. That is process
* synchronous but doesn't hold any locks, so we need to make sure we
@@ -1065,7 +1066,7 @@ ssize_t redirected_tty_write(struct file *file, const char __user *buf,
return tty_write(file, buf, count, ppos);
}

-/**
+/*
* tty_send_xchar - send priority character
*
* Send a high priority character to the tty even if stopped
@@ -1143,6 +1144,7 @@ static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p)
/**
* tty_driver_lookup_tty() - find an existing tty, if any
* @driver: the driver for the tty
+ * @file: file object
* @idx: the minor number
*
* Return the tty, if found. If not found, return NULL or ERR_PTR() if the
@@ -1494,6 +1496,8 @@ EXPORT_SYMBOL(tty_kref_put);

/**
* release_tty - release tty structure memory
+ * @tty: tty device release
+ * @idx: index of the tty device release
*
* Release both @tty and a possible linked partner (think pty pair),
* and decrement the refcount of the backing module.
@@ -2961,7 +2965,7 @@ static struct device *tty_get_device(struct tty_struct *tty)
}


-/**
+/*
* alloc_tty_struct
*
* This subroutine allocates and initializes a tty structure.
--
2.25.1

2020-11-04 19:41:19

by Lee Jones

[permalink] [raw]
Subject: [PATCH 04/36] tty: tty_io: Move 'tty_sysctl_init's prototype to shared space

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

drivers/tty/tty_ldisc.c:883:6: warning: no previous prototype for ‘tty_sysctl_init’ [-Wmissing-prototypes]
883 | void tty_sysctl_init(void)
| ^~~~~~~~~~~~~~~

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Nick Holloway <[email protected]>
Cc: -- <[email protected]>
Cc: Marko Kohtala <[email protected]>
Cc: Bill Hawes <[email protected]>
Cc: "C. Scott Ananian" <[email protected]>
Cc: Russell King <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_io.c | 2 --
include/linux/tty.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 7a4c02548fb3f..88b00c47b606e 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -514,8 +514,6 @@ static const struct file_operations hung_up_tty_fops = {
static DEFINE_SPINLOCK(redirect_lock);
static struct file *redirect;

-extern void tty_sysctl_init(void);
-
/**
* tty_wakeup - request more data
* @tty: terminal
diff --git a/include/linux/tty.h b/include/linux/tty.h
index a99e9b8e4e316..10212c6e4345e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -716,6 +716,7 @@ extern int __must_check tty_ldisc_init(struct tty_struct *tty);
extern void tty_ldisc_deinit(struct tty_struct *tty);
extern int tty_ldisc_receive_buf(struct tty_ldisc *ld, const unsigned char *p,
char *f, int count);
+extern void tty_sysctl_init(void);

/* n_tty.c */
extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
--
2.25.1

2020-11-04 19:41:34

by Lee Jones

[permalink] [raw]
Subject: [PATCH 07/36] tty: tty_jobctrl: Add missing function parameter descriptions

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

drivers/tty/tty_jobctrl.c:32: warning: Function parameter or member 'sig' not described in '__tty_check_change'
drivers/tty/tty_jobctrl.c:95: warning: Function parameter or member 'tty' not described in '__proc_set_tty'
drivers/tty/tty_jobctrl.c:344: warning: Function parameter or member 'file' not described in 'tiocsctty'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_jobctrl.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c
index 28a23a0fef21c..2054e4164c660 100644
--- a/drivers/tty/tty_jobctrl.c
+++ b/drivers/tty/tty_jobctrl.c
@@ -21,6 +21,7 @@ static int is_ignored(int sig)
/**
* tty_check_change - check for POSIX terminal changes
* @tty: tty to check
+ * @sig: signal to send
*
* If we try to write to, or set the state of, a terminal and we're
* not in the foreground, send a SIGTTOU. If the signal is blocked or
@@ -83,6 +84,7 @@ void proc_clear_tty(struct task_struct *p)

/**
* proc_set_tty - set the controlling terminal
+ * @tty: tty structure
*
* Only callable by the session leader and only if it does not already have
* a controlling terminal.
@@ -330,6 +332,7 @@ void no_tty(void)
/**
* tiocsctty - set controlling tty
* @tty: tty structure
+ * @file: file structure used to check permissions
* @arg: user argument
*
* This ioctl is used to manage job control. It permits a session
--
2.25.1

2020-11-04 19:41:40

by Lee Jones

[permalink] [raw]
Subject: [PATCH 06/36] tty: tty_port: Demote obvious abuse of kernel-doc formatting

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

drivers/tty/tty_port.c:633: warning: Function parameter or member 'port' not described in 'tty_port_close'
drivers/tty/tty_port.c:633: warning: Function parameter or member 'tty' not described in 'tty_port_close'
drivers/tty/tty_port.c:633: warning: Function parameter or member 'filp' not described in 'tty_port_close'
drivers/tty/tty_port.c:672: warning: Function parameter or member 'port' not described in 'tty_port_open'
drivers/tty/tty_port.c:672: warning: Function parameter or member 'tty' not described in 'tty_port_open'
drivers/tty/tty_port.c:672: warning: Function parameter or member 'filp' not described in 'tty_port_open'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index ea80bf872f543..346d20f4a4862 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -623,7 +623,7 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty)
}
EXPORT_SYMBOL(tty_port_close_end);

-/**
+/*
* tty_port_close
*
* Caller holds tty lock
@@ -659,7 +659,7 @@ int tty_port_install(struct tty_port *port, struct tty_driver *driver,
}
EXPORT_SYMBOL_GPL(tty_port_install);

-/**
+/*
* tty_port_open
*
* Caller holds tty lock.
--
2.25.1

2020-11-04 19:41:40

by Lee Jones

[permalink] [raw]
Subject: [PATCH 01/36] tty: serdev: core: Remove unused variable 'dummy'

No need to have a dummy variable here.

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

drivers/tty/serdev/core.c: In function ‘serdev_controller_remove’:
drivers/tty/serdev/core.c:791:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]

Cc: Rob Herring <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serdev/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index c5f0d936b003a..fecc28a73b3b2 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -788,13 +788,10 @@ static int serdev_remove_device(struct device *dev, void *data)
*/
void serdev_controller_remove(struct serdev_controller *ctrl)
{
- int dummy;
-
if (!ctrl)
return;

- dummy = device_for_each_child(&ctrl->dev, NULL,
- serdev_remove_device);
+ device_for_each_child(&ctrl->dev, NULL, serdev_remove_device);
pm_runtime_disable(&ctrl->dev);
device_del(&ctrl->dev);
}
--
2.25.1

2020-11-04 19:41:50

by Lee Jones

[permalink] [raw]
Subject: [PATCH 25/36] tty: serial: sifive: Struct headers should start with 'struct <name>'

Also supply a missing member description.

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

drivers/tty/serial/sifive.c:157: warning: cannot understand function prototype: 'struct sifive_serial_port '

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/sifive.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
index 13eadcb8aec4e..1066eebe3b28b 100644
--- a/drivers/tty/serial/sifive.c
+++ b/drivers/tty/serial/sifive.c
@@ -144,12 +144,13 @@
*/

/**
- * sifive_serial_port - driver-specific data extension to struct uart_port
+ * struct sifive_serial_port - driver-specific data extension to struct uart_port
* @port: struct uart_port embedded in this struct
* @dev: struct device *
* @ier: shadowed copy of the interrupt enable register
* @clkin_rate: input clock to the UART IP block.
* @baud_rate: UART serial line rate (e.g., 115200 baud)
+ * @clk: reference to this device's clock
* @clk_notifier: clock rate change notifier for upstream clock changes
*
* Configuration data specific to this SiFive UART.
--
2.25.1

2020-11-04 19:42:00

by Lee Jones

[permalink] [raw]
Subject: [PATCH 20/36] tty: serial: msm_serial: Remove set but unused variable 'status'

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

drivers/tty/serial/msm_serial.c: In function ‘msm_complete_tx_dma’:
drivers/tty/serial/msm_serial.c:429:18: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]

Cc: Andy Gross <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Robert Love <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/msm_serial.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 87f005e5d2aff..ec31a809644a5 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -426,7 +426,6 @@ static void msm_complete_tx_dma(void *args)
struct circ_buf *xmit = &port->state->xmit;
struct msm_dma *dma = &msm_port->tx_dma;
struct dma_tx_state state;
- enum dma_status status;
unsigned long flags;
unsigned int count;
u32 val;
@@ -437,7 +436,7 @@ static void msm_complete_tx_dma(void *args)
if (!dma->count)
goto done;

- status = dmaengine_tx_status(dma->chan, dma->cookie, &state);
+ dmaengine_tx_status(dma->chan, dma->cookie, &state);

dma_unmap_single(port->dev, dma->phys, dma->count, dma->dir);

--
2.25.1

2020-11-04 19:42:08

by Lee Jones

[permalink] [raw]
Subject: [PATCH 10/36] tty: n_tty: Add 2 missing parameter descriptions

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

drivers/tty/n_tty.c:405: warning: Function parameter or member 'tty' not described in 'is_continuation'
drivers/tty/n_tty.c:1701: warning: Function parameter or member 'flow' not described in 'n_tty_receive_buf_common'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: "Andrew J. Kroll" <[email protected]>
Cc: processes-Sapan Bhatia <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/n_tty.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 7e5e363152607..319d68c8a5df3 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -396,6 +396,7 @@ static inline int is_utf8_continuation(unsigned char c)
/**
* is_continuation - multibyte check
* @c: byte to check
+ * @tty: terminal device
*
* Returns true if the utf8 character 'c' is a multibyte continuation
* character and the terminal is in unicode mode.
@@ -1668,6 +1669,7 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
* @cp: input chars
* @fp: flags for each char (if NULL, all chars are TTY_NORMAL)
* @count: number of input chars in @cp
+ * @flow: enable flow control
*
* Called by the terminal driver when a block of characters has
* been received. This function must be called from soft contexts
--
2.25.1

2020-11-04 19:42:13

by Lee Jones

[permalink] [raw]
Subject: [PATCH 09/36] tty: vt: consolemap: Demote weakly documented function header

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

drivers/tty/vt/consolemap.c:739: warning: Function parameter or member 'ct' not described in 'con_get_unimap'
drivers/tty/vt/consolemap.c:739: warning: Function parameter or member 'uct' not described in 'con_get_unimap'
drivers/tty/vt/consolemap.c:739: warning: Function parameter or member 'list' not described in 'con_get_unimap'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Jakub Jelinek <[email protected]>
Cc: Stanislav Voronyi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/vt/consolemap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 5d778c0aa0091..f7d015c67963d 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -728,9 +728,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc)
}
EXPORT_SYMBOL(con_copy_unimap);

-/**
+/*
* con_get_unimap - get the unicode map
- * @vc: the console to read from
*
* Read the console unicode data for this console. Called from the ioctl
* handlers.
--
2.25.1

2020-11-04 19:42:40

by Lee Jones

[permalink] [raw]
Subject: [PATCH 18/36] tty: n_gsm: Demote obvious abuse of kernel-doc and supply other missing docss

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

drivers/tty/n_gsm.c:85: warning: Function parameter or member 'ref' not described in 'gsm_mux_net'
drivers/tty/n_gsm.c:85: warning: Function parameter or member 'dlci' not described in 'gsm_mux_net'
drivers/tty/n_gsm.c:664: warning: Function parameter or member 'dlci' not described in 'gsm_data_kick'
drivers/tty/n_gsm.c:1015: warning: Function parameter or member 'clen' not described in 'gsm_process_modem'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/n_gsm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 25f3152089c2a..c676fa89ee0b6 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -74,7 +74,7 @@ module_param(debug, int, 0600);
#define MAX_MTU 1500
#define GSM_NET_TX_TIMEOUT (HZ*10)

-/**
+/*
* struct gsm_mux_net - network interface
*
* Created when net interface is initialized.
@@ -651,6 +651,7 @@ static struct gsm_msg *gsm_data_alloc(struct gsm_mux *gsm, u8 addr, int len,
/**
* gsm_data_kick - poke the queue
* @gsm: GSM Mux
+ * @dlci: DLCI sending the data
*
* The tty device has called us to indicate that room has appeared in
* the transmit queue. Ram more data into the pipe if we have any
@@ -1005,6 +1006,7 @@ static void gsm_control_reply(struct gsm_mux *gsm, int cmd, const u8 *data,
* @tty: virtual tty bound to the DLCI
* @dlci: DLCI to affect
* @modem: modem bits (full EA)
+ * @clen: command length
*
* Used when a modem control message or line state inline in adaption
* layer 2 is processed. Sort out the local modem state and throttles
--
2.25.1

2020-11-04 19:43:05

by Lee Jones

[permalink] [raw]
Subject: [PATCH 08/36] tty: tty_ldisc: Fix some kernel-doc related misdemeanours

- Functions must follow directly on from their headers
- Demote non-conforming kernel-doc header
- Ensure notes have unique section names
- Provide missing description for 'reinit'

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

drivers/tty/tty_ldisc.c:158: warning: cannot understand function prototype: 'int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); '
drivers/tty/tty_ldisc.c:199: warning: Function parameter or member 'ld' not described in 'tty_ldisc_put'
drivers/tty/tty_ldisc.c:260: warning: duplicate section name 'Note'
drivers/tty/tty_ldisc.c:717: warning: Function parameter or member 'reinit' not described in 'tty_ldisc_hangup'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_ldisc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index fe37ec331289b..aced2bf6173be 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -135,6 +135,7 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags);
}

+static int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD);
/**
* tty_ldisc_get - take a reference to an ldisc
* @disc: ldisc number
@@ -155,8 +156,6 @@ static void put_ldops(struct tty_ldisc_ops *ldops)
* takes tty_ldiscs_lock to guard against ldisc races
*/

-static int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD);
-
static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
{
struct tty_ldisc *ld;
@@ -190,7 +189,7 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
return ld;
}

-/**
+/*
* tty_ldisc_put - release the ldisc
*
* Complement of tty_ldisc_get().
@@ -250,12 +249,12 @@ const struct seq_operations tty_ldiscs_seq_ops = {
* Returns: NULL if the tty has been hungup and not re-opened with
* a new file descriptor, otherwise valid ldisc reference
*
- * Note: Must not be called from an IRQ/timer context. The caller
+ * Note 1: Must not be called from an IRQ/timer context. The caller
* must also be careful not to hold other locks that will deadlock
* against a discipline change, such as an existing ldisc reference
* (which we check for)
*
- * Note: a file_operations routine (read/poll/write) should use this
+ * Note 2: a file_operations routine (read/poll/write) should use this
* function to wait for any ldisc lifetime events to finish.
*/

@@ -701,6 +700,7 @@ int tty_ldisc_reinit(struct tty_struct *tty, int disc)
/**
* tty_ldisc_hangup - hangup ldisc reset
* @tty: tty being hung up
+ * @reinit: whether to re-initialise the tty
*
* Some tty devices reset their termios when they receive a hangup
* event. In that situation we must also switch back to N_TTY properly
--
2.25.1

2020-11-04 19:43:35

by Lee Jones

[permalink] [raw]
Subject: [PATCH 05/36] tty: tty_buffer: Add missing description for 'limit'

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

drivers/tty/tty_buffer.c:592: warning: Function parameter or member 'limit' not described in 'tty_buffer_set_limit'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/tty_buffer.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index bd2d91546e327..6d4995a5f3187 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -583,6 +583,7 @@ void tty_buffer_init(struct tty_port *port)
/**
* tty_buffer_set_limit - change the tty buffer memory limit
* @port: tty port to change
+ * @limit: memory limit to set
*
* Change the tty buffer memory limit.
* Must be called before the other tty buffer functions are used.
--
2.25.1

2020-11-04 20:42:25

by Lee Jones

[permalink] [raw]
Subject: [PATCH 22/36] tty: serial: xilinx_uartps: Supply description for missing member 'cts_override'

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

drivers/tty/serial/xilinx_uartps.c:205: warning: Function parameter or member 'cts_override' not described in 'cdns_uart'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/xilinx_uartps.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index a9b1ee27183a7..a14c5d9964739 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -192,6 +192,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
* @baud: Current baud rate
* @clk_rate_change_nb: Notifier block for clock changes
* @quirks: Flags for RXBS support.
+ * @cts_override: Modem control state override
*/
struct cdns_uart {
struct uart_port *port;
--
2.25.1

2020-11-04 23:40:00

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH 31/36] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location

Lee Jones <[email protected]> writes:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
> 385 | void __init hvc_vio_init_early(void)
> | ^~~~~~~~~~~~~~~~~~
>
> Cc: Michael Ellerman <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> arch/powerpc/include/asm/hvconsole.h | 3 +++
> arch/powerpc/platforms/pseries/pseries.h | 3 ---
> arch/powerpc/platforms/pseries/setup.c | 1 +
> 3 files changed, 4 insertions(+), 3 deletions(-)

Acked-by: Michael Ellerman <[email protected]>

> diff --git a/arch/powerpc/include/asm/hvconsole.h b/arch/powerpc/include/asm/hvconsole.h
> index 999ed5ac90531..936a1ee1ac786 100644
> --- a/arch/powerpc/include/asm/hvconsole.h
> +++ b/arch/powerpc/include/asm/hvconsole.h
> @@ -24,5 +24,8 @@
> extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
> extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
>
> +/* Provided by HVC VIO */
> +extern void hvc_vio_init_early(void);

extern isn't needed, but don't feel you need to respin just to drop it.

cheers

2020-11-05 00:54:16

by Lee Jones

[permalink] [raw]
Subject: [PATCH 21/36] tty: serial: ifx6x60: Fix function documentation headers

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

drivers/tty/serial/ifx6x60.c:553: warning: Function parameter or member 'tty' not described in 'ifx_port_activate'
drivers/tty/serial/ifx6x60.c:728: warning: Function parameter or member 't' not described in 'ifx_spi_io'
drivers/tty/serial/ifx6x60.c:728: warning: Excess function parameter 'data' description in 'ifx_spi_io'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Filip Aben <[email protected]>
Cc: Joseph Barrow <[email protected]>
Cc: Jan Dumon <[email protected]>
Cc: Russ Gorby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/ifx6x60.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 21d519c804cb9..182e0ccd60b2c 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -545,6 +545,7 @@ static void ifx_spi_hangup(struct tty_struct *tty)
/**
* ifx_port_activate
* @port: our tty port
+ * @tty: our tty device
*
* tty port activate method - called for first open. Serialized
* with hangup and shutdown by the tty layer.
@@ -719,7 +720,7 @@ static void ifx_spi_complete(void *ctx)

/**
* ifx_spio_io - I/O tasklet
- * @data: our SPI device
+ * @t: tasklet construct used to fetch the SPI device
*
* Queue data for transmission if possible and then kick off the
* transfer.
--
2.25.1

2020-11-05 00:55:30

by Lee Jones

[permalink] [raw]
Subject: [PATCH 32/36] tty: hvc: hvc_vio: Staticify function invoked only by reference

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

drivers/tty/hvc/hvc_vio.c:181:6: warning: no previous prototype for ‘hvterm_hvsi_hangup’ [-Wmissing-prototypes]
181 | void hvterm_hvsi_hangup(struct hvc_struct *hp, int data)
| ^~~~~~~~~~~~~~~~~~

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/hvc/hvc_vio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c
index 7af54d6ed5b84..798f27f40cc2d 100644
--- a/drivers/tty/hvc/hvc_vio.c
+++ b/drivers/tty/hvc/hvc_vio.c
@@ -178,7 +178,7 @@ static void hvterm_hvsi_close(struct hvc_struct *hp, int data)
notifier_del_irq(hp, data);
}

-void hvterm_hvsi_hangup(struct hvc_struct *hp, int data)
+static void hvterm_hvsi_hangup(struct hvc_struct *hp, int data)
{
struct hvterm_priv *pv = hvterm_privs[hp->vtermno];

--
2.25.1

2020-11-05 01:17:16

by Lee Jones

[permalink] [raw]
Subject: [PATCH 33/36] tty: hvc: hvc_opal: Staticify function invoked by reference

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

drivers/tty/hvc/hvc_opal.c:106:6: warning: no previous prototype for ‘hvc_opal_hvsi_hangup’ [-Wmissing-prototypes]

Cc: Michael Ellerman <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/hvc/hvc_opal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index c66412566efce..056ae21a51214 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -103,7 +103,7 @@ static void hvc_opal_hvsi_close(struct hvc_struct *hp, int data)
notifier_del_irq(hp, data);
}

-void hvc_opal_hvsi_hangup(struct hvc_struct *hp, int data)
+static void hvc_opal_hvsi_hangup(struct hvc_struct *hp, int data)
{
struct hvc_opal_priv *pv = hvc_opal_privs[hp->vtermno];

--
2.25.1

2020-11-05 01:17:34

by Lee Jones

[permalink] [raw]
Subject: [PATCH 23/36] tty: synclink_gt: Demote one kernel-doc header and repair another

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

drivers/tty/synclink_gt.c:633: warning: Function parameter or member 'tty' not described in 'ldisc_receive_buf'
drivers/tty/synclink_gt.c:633: warning: Function parameter or member 'data' not described in 'ldisc_receive_buf'
drivers/tty/synclink_gt.c:633: warning: Function parameter or member 'flags' not described in 'ldisc_receive_buf'
drivers/tty/synclink_gt.c:633: warning: Function parameter or member 'count' not described in 'ldisc_receive_buf'
drivers/tty/synclink_gt.c:1683: warning: Function parameter or member 'txqueue' not described in 'hdlcdev_tx_timeout'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/synclink_gt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index afa4cc52e48d7..c0b384e3ed4de 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -620,7 +620,7 @@ static inline int sanity_check(struct slgt_info *info, char *devname, const char
return 0;
}

-/**
+/*
* line discipline callback wrappers
*
* The wrappers maintain line discipline references
@@ -1678,6 +1678,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/**
* hdlcdev_tx_timeout - called by network layer when transmit timeout is detected
* @dev: pointer to network device structure
+ * @txqueue: unused
*/
static void hdlcdev_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
--
2.25.1

2020-11-05 01:22:37

by Lee Jones

[permalink] [raw]
Subject: [PATCH 30/36] tty: serial: serial-tegra: Provide some missing struct member descriptions

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

drivers/tty/serial/serial-tegra.c:94: warning: Function parameter or member 'fifo_mode_enable_status' not described in 'tegra_uart_chip_data'
drivers/tty/serial/serial-tegra.c:94: warning: Function parameter or member 'uart_max_port' not described in 'tegra_uart_chip_data'
drivers/tty/serial/serial-tegra.c:94: warning: Function parameter or member 'max_dma_burst_bytes' not described in 'tegra_uart_chip_data'
drivers/tty/serial/serial-tegra.c:94: warning: Function parameter or member 'error_tolerance_low_range' not described in 'tegra_uart_chip_data'
drivers/tty/serial/serial-tegra.c:94: warning: Function parameter or member 'error_tolerance_high_range' not described in 'tegra_uart_chip_data'

Cc: Laxman Dewangan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/serial/serial-tegra.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index c363ee0470f45..bbae072a125db 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -81,6 +81,11 @@
* @allow_txfifo_reset_fifo_mode: allow_tx fifo reset with fifo mode or not.
* Tegra30 does not allow this.
* @support_clk_src_div: Clock source support the clock divider.
+ * @fifo_mode_enable_status: Is FIFO mode enabled?
+ * @uart_max_port: Maximum number of UART ports
+ * @max_dma_burst_bytes: Maximum size of DMA bursts
+ * @error_tolerance_low_range: Lowest number in the error tolerance range
+ * @error_tolerance_high_range: Highest number in the error tolerance range
*/
struct tegra_uart_chip_data {
bool tx_fifo_full_status;
--
2.25.1

2020-11-05 01:23:23

by Lee Jones

[permalink] [raw]
Subject: [PATCH 26/36] tty: synclinkmp: Add missing description for function param 'txqueue'

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

drivers/tty/synclinkmp.c:1808: warning: Function parameter or member 'txqueue' not described in 'hdlcdev_tx_timeout'

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/tty/synclinkmp.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index ce08c5ec331cc..0ca738f61a35b 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -1803,6 +1803,7 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/**
* hdlcdev_tx_timeout - called by network layer when transmit timeout is detected
* @dev: pointer to network device structure
+ * @txqueue: unused
*/
static void hdlcdev_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
--
2.25.1

2020-11-05 01:56:01

by Vladimir Zapolskiy

[permalink] [raw]
Subject: Re: [PATCH 19/36] tty: serial: lpc32xx_hs: Remove unused variable 'tmp'

Hi Lee,

On 11/4/20 9:35 PM, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/serial/lpc32xx_hs.c: In function ‘__serial_uart_flush’:
> drivers/tty/serial/lpc32xx_hs.c:244:6: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Vladimir Zapolskiy <[email protected]>
> Cc: Sylvain Lemieux <[email protected]>
> Cc: Kevin Wells <[email protected]>
> Cc: Roland Stigge <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/serial/lpc32xx_hs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
> index b5898c9320361..1fa098d7aec4b 100644
> --- a/drivers/tty/serial/lpc32xx_hs.c
> +++ b/drivers/tty/serial/lpc32xx_hs.c
> @@ -241,12 +241,11 @@ static unsigned int __serial_get_clock_div(unsigned long uartclk,
>
> static void __serial_uart_flush(struct uart_port *port)
> {
> - u32 tmp;
> int cnt = 0;
>
> while ((readl(LPC32XX_HSUART_LEVEL(port->membase)) > 0) &&
> (cnt++ < FIFO_READ_LIMIT))
> - tmp = readl(LPC32XX_HSUART_FIFO(port->membase));
> + readl(LPC32XX_HSUART_FIFO(port->membase));
> }
>
> static void __serial_lpc32xx_rx(struct uart_port *port)
>

Thank you for the change.

Acked-by: Vladimir Zapolskiy <[email protected]>

I'm sure the change is correct, likely the local variable was introduced
to prevent an unwanted probable optimization by some odd/ancient compiler.

--
Best wishes,
Vladimir

2020-11-05 07:08:54

by Christophe Leroy

[permalink] [raw]
Subject: Re: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable __always_unused



Le 04/11/2020 à 20:35, Lee Jones a écrit :
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/serial/pmac_zilog.h:365:58: warning: variable ‘garbage’ set but not used [-Wunused-but-set-variable]

Explain how you are fixing this warning.

Setting __always_unused is usually not the good solution for fixing this warning, but here I guess
this is likely the good solution. But it should be explained why.

Christophe


>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Michael Ellerman <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/serial/pmac_zilog.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/pmac_zilog.h b/drivers/tty/serial/pmac_zilog.h
> index bb874e76810e0..968aec7c1cf82 100644
> --- a/drivers/tty/serial/pmac_zilog.h
> +++ b/drivers/tty/serial/pmac_zilog.h
> @@ -362,7 +362,7 @@ static inline void zssync(struct uart_pmac_port *port)
>
> /* Misc macros */
> #define ZS_CLEARERR(port) (write_zsreg(port, 0, ERR_RES))
> -#define ZS_CLEARFIFO(port) do { volatile unsigned char garbage; \
> +#define ZS_CLEARFIFO(port) do { volatile unsigned char __always_unused garbage; \
> garbage = read_zsdata(port); \
> garbage = read_zsdata(port); \
> garbage = read_zsdata(port); \
>

2020-11-05 07:12:37

by Christophe Leroy

[permalink] [raw]
Subject: Re: [PATCH 31/36] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location



Le 04/11/2020 à 20:35, Lee Jones a écrit :
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
> 385 | void __init hvc_vio_init_early(void)
> | ^~~~~~~~~~~~~~~~~~
>
> Cc: Michael Ellerman <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> arch/powerpc/include/asm/hvconsole.h | 3 +++
> arch/powerpc/platforms/pseries/pseries.h | 3 ---
> arch/powerpc/platforms/pseries/setup.c | 1 +
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/hvconsole.h b/arch/powerpc/include/asm/hvconsole.h
> index 999ed5ac90531..936a1ee1ac786 100644
> --- a/arch/powerpc/include/asm/hvconsole.h
> +++ b/arch/powerpc/include/asm/hvconsole.h
> @@ -24,5 +24,8 @@
> extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
> extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
>
> +/* Provided by HVC VIO */
> +extern void hvc_vio_init_early(void);
> +

Declaring a prototype 'extern' is pointless. Don't add new misuse of 'extern' keyword.


> #endif /* __KERNEL__ */
> #endif /* _PPC64_HVCONSOLE_H */
> diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
> index 13fa370a87e4e..7be5b054dfc36 100644
> --- a/arch/powerpc/platforms/pseries/pseries.h
> +++ b/arch/powerpc/platforms/pseries/pseries.h
> @@ -43,9 +43,6 @@ extern void pSeries_final_fixup(void);
> /* Poweron flag used for enabling auto ups restart */
> extern unsigned long rtas_poweron_auto;
>
> -/* Provided by HVC VIO */
> -extern void hvc_vio_init_early(void);
> -
> /* Dynamic logical Partitioning/Mobility */
> extern void dlpar_free_cc_nodes(struct device_node *);
> extern void dlpar_free_cc_property(struct property *);
> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
> index 633c45ec406da..6999b83f06612 100644
> --- a/arch/powerpc/platforms/pseries/setup.c
> +++ b/arch/powerpc/platforms/pseries/setup.c
> @@ -71,6 +71,7 @@
> #include <asm/swiotlb.h>
> #include <asm/svm.h>
> #include <asm/dtl.h>
> +#include <asm/hvconsole.h>
>
> #include "pseries.h"
> #include "../../../../drivers/pci/pci.h"
>

Christophe

2020-11-05 07:41:50

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable __always_unused

On 05. 11. 20, 8:04, Christophe Leroy wrote:
>
>
> Le 04/11/2020 à 20:35, Lee Jones a écrit :
>> Fixes the following W=1 kernel build warning(s):
>>
>>   drivers/tty/serial/pmac_zilog.h:365:58: warning: variable ‘garbage’
>> set but not used [-Wunused-but-set-variable]
>
> Explain how you are fixing this warning.
>
> Setting  __always_unused is usually not the good solution for fixing
> this warning, but here I guess this is likely the good solution. But it
> should be explained why.

Or, why is the "garbage =" needed in the first place? read_zsdata is not
defined with __warn_unused_result__. And even if it was, would
(void)!read_zsdata(port) fix it?

>> Cc: Greg Kroah-Hartman <[email protected]>
>> Cc: Jiri Slaby <[email protected]>
>> Cc: Michael Ellerman <[email protected]>
>> Cc: Benjamin Herrenschmidt <[email protected]>
>> Cc: Paul Mackerras <[email protected]>
>> Cc: [email protected]
>> Cc: [email protected]
>> Signed-off-by: Lee Jones <[email protected]>
>> ---
>>   drivers/tty/serial/pmac_zilog.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/pmac_zilog.h
>> b/drivers/tty/serial/pmac_zilog.h
>> index bb874e76810e0..968aec7c1cf82 100644
>> --- a/drivers/tty/serial/pmac_zilog.h
>> +++ b/drivers/tty/serial/pmac_zilog.h
>> @@ -362,7 +362,7 @@ static inline void zssync(struct uart_pmac_port
>> *port)
>>   /* Misc macros */
>>   #define ZS_CLEARERR(port)    (write_zsreg(port, 0, ERR_RES))
>> -#define ZS_CLEARFIFO(port)   do { volatile unsigned char garbage; \
>> +#define ZS_CLEARFIFO(port)   do { volatile unsigned char
>> __always_unused garbage; \
>>                        garbage = read_zsdata(port); \
>>                        garbage = read_zsdata(port); \
>>                        garbage = read_zsdata(port); \
>>

thanks,
--
js

2020-11-05 08:17:36

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 08/36] tty: tty_ldisc: Fix some kernel-doc related misdemeanours

On 04. 11. 20, 20:35, Lee Jones wrote:
> - Functions must follow directly on from their headers
> - Demote non-conforming kernel-doc header
> - Ensure notes have unique section names
> - Provide missing description for 'reinit'
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/tty_ldisc.c:158: warning: cannot understand function prototype: 'int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); '
> drivers/tty/tty_ldisc.c:199: warning: Function parameter or member 'ld' not described in 'tty_ldisc_put'
> drivers/tty/tty_ldisc.c:260: warning: duplicate section name 'Note'
> drivers/tty/tty_ldisc.c:717: warning: Function parameter or member 'reinit' not described in 'tty_ldisc_hangup'
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/tty_ldisc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
> index fe37ec331289b..aced2bf6173be 100644
> --- a/drivers/tty/tty_ldisc.c
> +++ b/drivers/tty/tty_ldisc.c
> @@ -190,7 +189,7 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
> return ld;
> }
>
> -/**
> +/*
> * tty_ldisc_put - release the ldisc

Having tty_ldisc_get in kernel-doc, while tty_ldisc_put not doesn't make
much sense. What's missing to tty_ldisc_put to conform to kernel-doc?

thanks,
--
js
suse labs

2020-11-05 08:20:41

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 12/36] tty: tty_io: Fix some kernel-doc issues

On 04. 11. 20, 20:35, Lee Jones wrote:
> Demote non-conformant headers and supply some missing descriptions.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/tty_io.c:218: warning: Function parameter or member 'file' not described in 'tty_free_file'
> drivers/tty/tty_io.c:566: warning: Function parameter or member 'exit_session' not described in '__tty_hangup'
> drivers/tty/tty_io.c:1077: warning: Function parameter or member 'tty' not described in 'tty_send_xchar'
> drivers/tty/tty_io.c:1077: warning: Function parameter or member 'ch' not described in 'tty_send_xchar'
> drivers/tty/tty_io.c:1155: warning: Function parameter or member 'file' not described in 'tty_driver_lookup_tty'
> drivers/tty/tty_io.c:1508: warning: Function parameter or member 'tty' not described in 'release_tty'
> drivers/tty/tty_io.c:1508: warning: Function parameter or member 'idx' not described in 'release_tty'
> drivers/tty/tty_io.c:2973: warning: Function parameter or member 'driver' not described in 'alloc_tty_struct'
> drivers/tty/tty_io.c:2973: warning: Function parameter or member 'idx' not described in 'alloc_tty_struct'
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Nick Holloway <[email protected]>
> Cc: -- <[email protected]>
> Cc: Marko Kohtala <[email protected]>
> Cc: Bill Hawes <[email protected]>
> Cc: "C. Scott Ananian" <[email protected]>
> Cc: Russell King <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/tty_io.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> index 88b00c47b606e..f50286fb080da 100644
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -2961,7 +2965,7 @@ static struct device *tty_get_device(struct tty_struct *tty)
> }
>
>
> -/**
> +/*
> * alloc_tty_struct
> *
> * This subroutine allocates and initializes a tty structure.

Why do you randomly sometimes fix kernel-doc and sometimes remove
functions from kernel-doc? What's the rule? For example,
alloc_tty_struct is among the ones, I would like to see fixed instead of
removed from kernel-doc.

thanks,
--
js
suse labs

2020-11-05 08:29:50

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On 04. 11. 20, 20:35, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/synclinkmp.c: In function ‘init_adapter’:
> drivers/tty/synclinkmp.c:5167:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/synclinkmp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
> index 0ca738f61a35b..75f494bfdcbed 100644
> --- a/drivers/tty/synclinkmp.c
> +++ b/drivers/tty/synclinkmp.c
> @@ -5165,7 +5165,7 @@ static bool init_adapter(SLMP_INFO *info)
>
> /* Set BIT30 of Local Control Reg 0x50 to reset SCA */
> volatile u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50);
> - u32 readval;
> + u32 __always_unused readval;

Why not just remove readval completely as in other cases?

And the loop can be turned into ndelay:

/*
* Force at least 170ns delay before clearing
* reset bit. Each read from LCR takes at least
* 30ns so 10 times for 300ns to be safe.
*/
for(i=0;i<10;i++)
readval = *MiscCtrl;


thanks,
--
js
suse labs

2020-11-05 08:38:31

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable __always_unused

On Thu, 05 Nov 2020, Jiri Slaby wrote:

> On 05. 11. 20, 8:04, Christophe Leroy wrote:
> >
> >
> > Le 04/11/2020 à 20:35, Lee Jones a écrit :
> > > Fixes the following W=1 kernel build warning(s):
> > >
> > >   drivers/tty/serial/pmac_zilog.h:365:58: warning: variable
> > > ‘garbage’ set but not used [-Wunused-but-set-variable]
> >
> > Explain how you are fixing this warning.
> >
> > Setting  __always_unused is usually not the good solution for fixing
> > this warning, but here I guess this is likely the good solution. But it
> > should be explained why.

There are normally 3 ways to fix this warning;

- Start using/checking the variable/result
- Remove the variable
- Mark it as __{always,maybe}_unused

The later just tells the compiler that not checking the resultant
value is intentional. There are some functions (as Jiri mentions
below) which are marked as '__must_check' which *require* a dummy
(garbage) variable to be used.

> Or, why is the "garbage =" needed in the first place? read_zsdata is not
> defined with __warn_unused_result__.

I used '__always_used' here for fear of breaking something.

However, if it's safe to remove it, then all the better.

> And even if it was, would (void)!read_zsdata(port) fix it?

That's hideous. :D

*Much* better to just use '__always_used' in that use-case.

> > > Cc: Greg Kroah-Hartman <[email protected]>
> > > Cc: Jiri Slaby <[email protected]>
> > > Cc: Michael Ellerman <[email protected]>
> > > Cc: Benjamin Herrenschmidt <[email protected]>
> > > Cc: Paul Mackerras <[email protected]>
> > > Cc: [email protected]
> > > Cc: [email protected]
> > > Signed-off-by: Lee Jones <[email protected]>
> > > ---
> > >   drivers/tty/serial/pmac_zilog.h | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/tty/serial/pmac_zilog.h
> > > b/drivers/tty/serial/pmac_zilog.h
> > > index bb874e76810e0..968aec7c1cf82 100644
> > > --- a/drivers/tty/serial/pmac_zilog.h
> > > +++ b/drivers/tty/serial/pmac_zilog.h
> > > @@ -362,7 +362,7 @@ static inline void zssync(struct uart_pmac_port
> > > *port)
> > >   /* Misc macros */
> > >   #define ZS_CLEARERR(port)    (write_zsreg(port, 0, ERR_RES))
> > > -#define ZS_CLEARFIFO(port)   do { volatile unsigned char garbage; \
> > > +#define ZS_CLEARFIFO(port)   do { volatile unsigned char
> > > __always_unused garbage; \
> > >                        garbage = read_zsdata(port); \
> > >                        garbage = read_zsdata(port); \
> > >                        garbage = read_zsdata(port); \
> > >
>
> thanks,

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

2020-11-05 08:39:18

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 35/36] tty: synclink: Mark disposable variables as __always_unused

On 04. 11. 20, 20:35, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/synclink.c: In function ‘usc_reset’:
> drivers/tty/synclink.c:5571:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]
> drivers/tty/synclink.c: In function ‘mgsl_load_pci_memory’:
> drivers/tty/synclink.c:7267:16: warning: variable ‘Dummy’ set but not used [-Wunused-but-set-variable]
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/synclink.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
> index c8324d58ef564..8ed64b1e7c378 100644
> --- a/drivers/tty/synclink.c
> +++ b/drivers/tty/synclink.c
> @@ -5568,7 +5568,7 @@ static void usc_load_txfifo( struct mgsl_struct *info )
> static void usc_reset( struct mgsl_struct *info )
> {
> int i;
> - u32 readval;
> + u32 __always_unused readval;

The same as in synclinkmp.

>
> /* Set BIT30 of Misc Control Register */
> /* (Local Control Register 0x50) to force reset of USC. */
> @@ -7264,7 +7264,7 @@ static void mgsl_load_pci_memory( char* TargetPtr, const char* SourcePtr,
>
> unsigned short Intervalcount = count / PCI_LOAD_INTERVAL;
> unsigned short Index;
> - unsigned long Dummy;
> + unsigned long __always_unused Dummy;

You can kill it completely.

>
> for ( Index = 0 ; Index < Intervalcount ; Index++ )
> {
>

thanks,
--
js
suse labs

2020-11-05 08:40:29

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 31/36] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location

On Thu, 05 Nov 2020, Christophe Leroy wrote:

>
>
> Le 04/11/2020 à 20:35, Lee Jones a écrit :
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
> > 385 | void __init hvc_vio_init_early(void)
> > | ^~~~~~~~~~~~~~~~~~
> >
> > Cc: Michael Ellerman <[email protected]>
> > Cc: Benjamin Herrenschmidt <[email protected]>
> > Cc: Paul Mackerras <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > arch/powerpc/include/asm/hvconsole.h | 3 +++
> > arch/powerpc/platforms/pseries/pseries.h | 3 ---
> > arch/powerpc/platforms/pseries/setup.c | 1 +
> > 3 files changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/hvconsole.h b/arch/powerpc/include/asm/hvconsole.h
> > index 999ed5ac90531..936a1ee1ac786 100644
> > --- a/arch/powerpc/include/asm/hvconsole.h
> > +++ b/arch/powerpc/include/asm/hvconsole.h
> > @@ -24,5 +24,8 @@
> > extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
> > extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
> > +/* Provided by HVC VIO */
> > +extern void hvc_vio_init_early(void);
> > +
>
> Declaring a prototype 'extern' is pointless. Don't add new misuse of 'extern' keyword.

No new code (misuse or otherwise) is being added in this patch.

It's just moved from one place to another.

I can also strip out 'extern' if it's preferred.

> > #endif /* __KERNEL__ */
> > #endif /* _PPC64_HVCONSOLE_H */
> > diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
> > index 13fa370a87e4e..7be5b054dfc36 100644
> > --- a/arch/powerpc/platforms/pseries/pseries.h
> > +++ b/arch/powerpc/platforms/pseries/pseries.h
> > @@ -43,9 +43,6 @@ extern void pSeries_final_fixup(void);
> > /* Poweron flag used for enabling auto ups restart */
> > extern unsigned long rtas_poweron_auto;
> > -/* Provided by HVC VIO */
> > -extern void hvc_vio_init_early(void);
> > -
> > /* Dynamic logical Partitioning/Mobility */
> > extern void dlpar_free_cc_nodes(struct device_node *);
> > extern void dlpar_free_cc_property(struct property *);
> > diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
> > index 633c45ec406da..6999b83f06612 100644
> > --- a/arch/powerpc/platforms/pseries/setup.c
> > +++ b/arch/powerpc/platforms/pseries/setup.c
> > @@ -71,6 +71,7 @@
> > #include <asm/swiotlb.h>
> > #include <asm/svm.h>
> > #include <asm/dtl.h>
> > +#include <asm/hvconsole.h>
> > #include "pseries.h"
> > #include "../../../../drivers/pci/pci.h"
> >
>
> Christophe

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

2020-11-05 08:42:05

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 31/36] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location

On Thu, 05 Nov 2020, Michael Ellerman wrote:

> Lee Jones <[email protected]> writes:
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
> > 385 | void __init hvc_vio_init_early(void)
> > | ^~~~~~~~~~~~~~~~~~
> >
> > Cc: Michael Ellerman <[email protected]>
> > Cc: Benjamin Herrenschmidt <[email protected]>
> > Cc: Paul Mackerras <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > arch/powerpc/include/asm/hvconsole.h | 3 +++
> > arch/powerpc/platforms/pseries/pseries.h | 3 ---
> > arch/powerpc/platforms/pseries/setup.c | 1 +
> > 3 files changed, 4 insertions(+), 3 deletions(-)
>
> Acked-by: Michael Ellerman <[email protected]>

Thanks.

> > diff --git a/arch/powerpc/include/asm/hvconsole.h b/arch/powerpc/include/asm/hvconsole.h
> > index 999ed5ac90531..936a1ee1ac786 100644
> > --- a/arch/powerpc/include/asm/hvconsole.h
> > +++ b/arch/powerpc/include/asm/hvconsole.h
> > @@ -24,5 +24,8 @@
> > extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
> > extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
> >
> > +/* Provided by HVC VIO */
> > +extern void hvc_vio_init_early(void);
>
> extern isn't needed, but don't feel you need to respin just to drop it.

That's fine. I don't mind re-spinning.

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

2020-11-05 08:47:57

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On Thu, 05 Nov 2020, Jiri Slaby wrote:

> On 04. 11. 20, 20:35, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/synclinkmp.c: In function ‘init_adapter’:
> > drivers/tty/synclinkmp.c:5167:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/tty/synclinkmp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
> > index 0ca738f61a35b..75f494bfdcbed 100644
> > --- a/drivers/tty/synclinkmp.c
> > +++ b/drivers/tty/synclinkmp.c
> > @@ -5165,7 +5165,7 @@ static bool init_adapter(SLMP_INFO *info)
> > /* Set BIT30 of Local Control Reg 0x50 to reset SCA */
> > volatile u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50);
> > - u32 readval;
> > + u32 __always_unused readval;
>
> Why not just remove readval completely as in other cases?

Because I don't know what the result would be.

Will the read still happen, or will the compiler optimise it away?

My changes should not affect any of the instructions i.e. the register
read must still take place

> And the loop can be turned into ndelay:
>
> /*
> * Force at least 170ns delay before clearing
> * reset bit. Each read from LCR takes at least
> * 30ns so 10 times for 300ns to be safe.
> */
> for(i=0;i<10;i++)
> readval = *MiscCtrl;

Again, since I can't test this, I do not want this patch to contain
any functional changes. AFAIC, the 10 register reads must still
happen after this patch is applied.

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

2020-11-05 08:56:29

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 12/36] tty: tty_io: Fix some kernel-doc issues

On Thu, 05 Nov 2020, Jiri Slaby wrote:

> On 04. 11. 20, 20:35, Lee Jones wrote:
> > Demote non-conformant headers and supply some missing descriptions.
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/tty_io.c:218: warning: Function parameter or member 'file' not described in 'tty_free_file'
> > drivers/tty/tty_io.c:566: warning: Function parameter or member 'exit_session' not described in '__tty_hangup'
> > drivers/tty/tty_io.c:1077: warning: Function parameter or member 'tty' not described in 'tty_send_xchar'
> > drivers/tty/tty_io.c:1077: warning: Function parameter or member 'ch' not described in 'tty_send_xchar'
> > drivers/tty/tty_io.c:1155: warning: Function parameter or member 'file' not described in 'tty_driver_lookup_tty'
> > drivers/tty/tty_io.c:1508: warning: Function parameter or member 'tty' not described in 'release_tty'
> > drivers/tty/tty_io.c:1508: warning: Function parameter or member 'idx' not described in 'release_tty'
> > drivers/tty/tty_io.c:2973: warning: Function parameter or member 'driver' not described in 'alloc_tty_struct'
> > drivers/tty/tty_io.c:2973: warning: Function parameter or member 'idx' not described in 'alloc_tty_struct'
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Cc: Nick Holloway <[email protected]>
> > Cc: -- <[email protected]>
> > Cc: Marko Kohtala <[email protected]>
> > Cc: Bill Hawes <[email protected]>
> > Cc: "C. Scott Ananian" <[email protected]>
> > Cc: Russell King <[email protected]>
> > Cc: Andrew Morton <[email protected]>
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/tty/tty_io.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> > index 88b00c47b606e..f50286fb080da 100644
> > --- a/drivers/tty/tty_io.c
> > +++ b/drivers/tty/tty_io.c
> > @@ -2961,7 +2965,7 @@ static struct device *tty_get_device(struct tty_struct *tty)
> > }
> > -/**
> > +/*
> > * alloc_tty_struct
> > *
> > * This subroutine allocates and initializes a tty structure.
>
> Why do you randomly sometimes fix kernel-doc and sometimes remove functions
> from kernel-doc? What's the rule?

The decision is made quickly (I am fixing literally 1000's of these),
but the process is definitely not random.

If there has been little or no attempt to document the function, it
gets demoted. If the developer has had a good crack at providing
descriptions and/or the header is just suffering with a little
incompleteness/doc-rot, then I'll fix it up.

Here for example, no attempt was made to provide any proper
documentation.

> For example, alloc_tty_struct is among the
> ones, I would like to see fixed instead of removed from kernel-doc.

There is nothing stopping anyone from providing said descriptions and
promoting it back up to kernel-doc. If you have good reasons for it
to be properly documented with kernel-doc, then it should also be
referenced from /Documentation using the kernel-doc:: notation.

Also see: scripts/find-unused-docs.sh

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

2020-11-05 08:56:41

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 08/36] tty: tty_ldisc: Fix some kernel-doc related misdemeanours

On Thu, 05 Nov 2020, Jiri Slaby wrote:

> On 04. 11. 20, 20:35, Lee Jones wrote:
> > - Functions must follow directly on from their headers
> > - Demote non-conforming kernel-doc header
> > - Ensure notes have unique section names
> > - Provide missing description for 'reinit'
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/tty_ldisc.c:158: warning: cannot understand function prototype: 'int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); '
> > drivers/tty/tty_ldisc.c:199: warning: Function parameter or member 'ld' not described in 'tty_ldisc_put'
> > drivers/tty/tty_ldisc.c:260: warning: duplicate section name 'Note'
> > drivers/tty/tty_ldisc.c:717: warning: Function parameter or member 'reinit' not described in 'tty_ldisc_hangup'
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/tty/tty_ldisc.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
> > index fe37ec331289b..aced2bf6173be 100644
> > --- a/drivers/tty/tty_ldisc.c
> > +++ b/drivers/tty/tty_ldisc.c
> > @@ -190,7 +189,7 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
> > return ld;
> > }
> > -/**
> > +/*
> > * tty_ldisc_put - release the ldisc
>
> Having tty_ldisc_get in kernel-doc, while tty_ldisc_put not doesn't make
> much sense. What's missing to tty_ldisc_put to conform to kernel-doc?

Where are they in kernel-doc? I don't see any references.

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

2020-11-05 08:59:31

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable __always_unused

On 05. 11. 20, 9:36, Lee Jones wrote:
> On Thu, 05 Nov 2020, Jiri Slaby wrote:
>
>> On 05. 11. 20, 8:04, Christophe Leroy wrote:
>>>
>>>
>>> Le 04/11/2020 à 20:35, Lee Jones a écrit :
>>>> Fixes the following W=1 kernel build warning(s):
>>>>
>>>>   drivers/tty/serial/pmac_zilog.h:365:58: warning: variable
>>>> ‘garbage’ set but not used [-Wunused-but-set-variable]
>>>
>>> Explain how you are fixing this warning.
>>>
>>> Setting  __always_unused is usually not the good solution for fixing
>>> this warning, but here I guess this is likely the good solution. But it
>>> should be explained why.
>
> There are normally 3 ways to fix this warning;
>
> - Start using/checking the variable/result
> - Remove the variable
> - Mark it as __{always,maybe}_unused
>
> The later just tells the compiler that not checking the resultant
> value is intentional. There are some functions (as Jiri mentions
> below) which are marked as '__must_check' which *require* a dummy
> (garbage) variable to be used.
>
>> Or, why is the "garbage =" needed in the first place? read_zsdata is not
>> defined with __warn_unused_result__.
>
> I used '__always_used' here for fear of breaking something.
>
> However, if it's safe to remove it, then all the better.

Yes please -- this "garbage" is one of the examples of volatile misuses.
If readb didn't work on volatile pointer, marking the return variable as
volatile wouldn't save it.

>> And even if it was, would (void)!read_zsdata(port) fix it?
>
> That's hideous. :D

Sure, marking reads as must_check would be insane.

> *Much* better to just use '__always_used' in that use-case.

Then using a dummy variable to fool must_check must mean must_check is
used incorrectly, no :)? But there are always exceptions…

thanks,
--
js
suse labs

2020-11-05 09:01:08

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 08/36] tty: tty_ldisc: Fix some kernel-doc related misdemeanours

On Thu, 05 Nov 2020, Lee Jones wrote:

> On Thu, 05 Nov 2020, Jiri Slaby wrote:
>
> > On 04. 11. 20, 20:35, Lee Jones wrote:
> > > - Functions must follow directly on from their headers
> > > - Demote non-conforming kernel-doc header
> > > - Ensure notes have unique section names
> > > - Provide missing description for 'reinit'
> > >
> > > Fixes the following W=1 kernel build warning(s):
> > >
> > > drivers/tty/tty_ldisc.c:158: warning: cannot understand function prototype: 'int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); '
> > > drivers/tty/tty_ldisc.c:199: warning: Function parameter or member 'ld' not described in 'tty_ldisc_put'
> > > drivers/tty/tty_ldisc.c:260: warning: duplicate section name 'Note'
> > > drivers/tty/tty_ldisc.c:717: warning: Function parameter or member 'reinit' not described in 'tty_ldisc_hangup'
> > >
> > > Cc: Greg Kroah-Hartman <[email protected]>
> > > Cc: Jiri Slaby <[email protected]>
> > > Signed-off-by: Lee Jones <[email protected]>
> > > ---
> > > drivers/tty/tty_ldisc.c | 10 +++++-----
> > > 1 file changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
> > > index fe37ec331289b..aced2bf6173be 100644
> > > --- a/drivers/tty/tty_ldisc.c
> > > +++ b/drivers/tty/tty_ldisc.c
> > > @@ -190,7 +189,7 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
> > > return ld;
> > > }
> > > -/**
> > > +/*
> > > * tty_ldisc_put - release the ldisc
> >
> > Having tty_ldisc_get in kernel-doc, while tty_ldisc_put not doesn't make
> > much sense. What's missing to tty_ldisc_put to conform to kernel-doc?
>
> Where are they in kernel-doc? I don't see any references.

Also:

$ ./scripts/find-unused-docs.sh drivers/tty/
The following files contain kerneldoc comments for exported functions that are not used in the formatted documentation
drivers/tty/n_tracesink.c
drivers/tty/tty_baudrate.c
drivers/tty/serial/8250/8250_port.c
drivers/tty/serdev/core.c
drivers/tty/vt/keyboard.c
drivers/tty/vt/selection.c
drivers/tty/vt/consolemap.c
drivers/tty/vt/vt.c
drivers/tty/tty_jobctrl.c
drivers/tty/tty_buffer.c
drivers/tty/n_tty.c
drivers/tty/hvc/hvc_console.c
drivers/tty/tty_ioctl.c
drivers/tty/sysrq.c
drivers/tty/tty_ldisc.c <---------
drivers/tty/tty_io.c
drivers/tty/tty_port.c

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

2020-11-05 09:02:21

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 35/36] tty: synclink: Mark disposable variables as __always_unused

On Thu, 05 Nov 2020, Jiri Slaby wrote:

> On 04. 11. 20, 20:35, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/synclink.c: In function ‘usc_reset’:
> > drivers/tty/synclink.c:5571:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]
> > drivers/tty/synclink.c: In function ‘mgsl_load_pci_memory’:
> > drivers/tty/synclink.c:7267:16: warning: variable ‘Dummy’ set but not used [-Wunused-but-set-variable]
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/tty/synclink.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
> > index c8324d58ef564..8ed64b1e7c378 100644
> > --- a/drivers/tty/synclink.c
> > +++ b/drivers/tty/synclink.c
> > @@ -5568,7 +5568,7 @@ static void usc_load_txfifo( struct mgsl_struct *info )
> > static void usc_reset( struct mgsl_struct *info )
> > {
> > int i;
> > - u32 readval;
> > + u32 __always_unused readval;
>
> The same as in synclinkmp.
>
> > /* Set BIT30 of Misc Control Register */
> > /* (Local Control Register 0x50) to force reset of USC. */
> > @@ -7264,7 +7264,7 @@ static void mgsl_load_pci_memory( char* TargetPtr, const char* SourcePtr,
> > unsigned short Intervalcount = count / PCI_LOAD_INTERVAL;
> > unsigned short Index;
> > - unsigned long Dummy;
> > + unsigned long __always_unused Dummy;
>
> You can kill it completely.

Great. Will fix.

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

2020-11-05 09:03:00

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 34/36] tty: serial: pmac_zilog: Make disposable variable __always_unused

On Thu, 05 Nov 2020, Jiri Slaby wrote:

> On 05. 11. 20, 9:36, Lee Jones wrote:
> > On Thu, 05 Nov 2020, Jiri Slaby wrote:
> >
> > > On 05. 11. 20, 8:04, Christophe Leroy wrote:
> > > >
> > > >
> > > > Le 04/11/2020 à 20:35, Lee Jones a écrit :
> > > > > Fixes the following W=1 kernel build warning(s):
> > > > >
> > > > >   drivers/tty/serial/pmac_zilog.h:365:58: warning: variable
> > > > > ‘garbage’ set but not used [-Wunused-but-set-variable]
> > > >
> > > > Explain how you are fixing this warning.
> > > >
> > > > Setting  __always_unused is usually not the good solution for fixing
> > > > this warning, but here I guess this is likely the good solution. But it
> > > > should be explained why.
> >
> > There are normally 3 ways to fix this warning;
> >
> > - Start using/checking the variable/result
> > - Remove the variable
> > - Mark it as __{always,maybe}_unused
> >
> > The later just tells the compiler that not checking the resultant
> > value is intentional. There are some functions (as Jiri mentions
> > below) which are marked as '__must_check' which *require* a dummy
> > (garbage) variable to be used.
> >
> > > Or, why is the "garbage =" needed in the first place? read_zsdata is not
> > > defined with __warn_unused_result__.
> >
> > I used '__always_used' here for fear of breaking something.
> >
> > However, if it's safe to remove it, then all the better.
>
> Yes please -- this "garbage" is one of the examples of volatile misuses. If
> readb didn't work on volatile pointer, marking the return variable as
> volatile wouldn't save it.
>
> > > And even if it was, would (void)!read_zsdata(port) fix it?
> >
> > That's hideous. :D
>
> Sure, marking reads as must_check would be insane.
>
> > *Much* better to just use '__always_used' in that use-case.
>
> Then using a dummy variable to fool must_check must mean must_check is used
> incorrectly, no :)? But there are always exceptions…

Agreed on all points.

Will fix.

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

2020-11-05 09:12:57

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On 05. 11. 20, 9:43, Lee Jones wrote:
> On Thu, 05 Nov 2020, Jiri Slaby wrote:
>
>> On 04. 11. 20, 20:35, Lee Jones wrote:
>>> Fixes the following W=1 kernel build warning(s):
>>>
>>> drivers/tty/synclinkmp.c: In function ‘init_adapter’:
>>> drivers/tty/synclinkmp.c:5167:6: warning: variable ‘readval’ set but not used [-Wunused-but-set-variable]
>>>
>>> Cc: Greg Kroah-Hartman <[email protected]>
>>> Cc: Jiri Slaby <[email protected]>
>>> Cc: [email protected]
>>> Signed-off-by: Lee Jones <[email protected]>
>>> ---
>>> drivers/tty/synclinkmp.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
>>> index 0ca738f61a35b..75f494bfdcbed 100644
>>> --- a/drivers/tty/synclinkmp.c
>>> +++ b/drivers/tty/synclinkmp.c
>>> @@ -5165,7 +5165,7 @@ static bool init_adapter(SLMP_INFO *info)
>>> /* Set BIT30 of Local Control Reg 0x50 to reset SCA */
>>> volatile u32 *MiscCtrl = (u32 *)(info->lcr_base + 0x50);
>>> - u32 readval;
>>> + u32 __always_unused readval;
>>
>> Why not just remove readval completely as in other cases?
>
> Because I don't know what the result would be.
>
> Will the read still happen, or will the compiler optimise it away?

The compiler will eliminate this dead store anyway. However given the
MiscCtrl pointer is volatile, the read proper must remain.

> My changes should not affect any of the instructions i.e. the register
> read must still take place

I understand. But the C specification helps here.

>> And the loop can be turned into ndelay:
>>
>> /*
>> * Force at least 170ns delay before clearing
>> * reset bit. Each read from LCR takes at least
>> * 30ns so 10 times for 300ns to be safe.
>> */
>> for(i=0;i<10;i++)
>> readval = *MiscCtrl;
>
> Again, since I can't test this, I do not want this patch to contain
> any functional changes. AFAIC, the 10 register reads must still
> happen after this patch is applied.

OK, let the loop alone. I would bet a half a pig that noone is able to
test this driver. But one has to write this for someone to raise and
admit they are still using it. In fact, there are _4_ google replies to
"Microgate Corporation" "SyncLink Multiport Adapter" "lspci".

thanks,
--
js
suse labs

2020-11-05 09:18:37

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 12/36] tty: tty_io: Fix some kernel-doc issues

On 05. 11. 20, 9:53, Lee Jones wrote:
>> For example, alloc_tty_struct is among the
>> ones, I would like to see fixed instead of removed from kernel-doc.
>
> There is nothing stopping anyone from providing said descriptions and
> promoting it back up to kernel-doc. If you have good reasons for it
> to be properly documented with kernel-doc, then it should also be
> referenced from /Documentation using the kernel-doc:: notation.
>
> Also see: scripts/find-unused-docs.sh

Thanks for this. I must admit, I haven't managed to get familiar with
this stuff yet.

--
js
suse labs

2020-11-05 09:42:11

by Paul Fulghum

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused



> On Nov 5, 2020, at 1:10 AM, Jiri Slaby <[email protected]> wrote:
>
> OK, let the loop alone. I would bet a half a pig that noone is able to test this driver. But one has to write this for someone to raise and admit they are still using it. In fact, there are _4_ google replies to "Microgate Corporation" "SyncLink Multiport Adapter" "lspci".



The hardware used with synclink.c and synclinkmp.c has not been manufactured for 15 years and was low volume. The chances of either driver still being in use is very low. Not even Microgate (me) has the ability to test either anymore (no hardware). I don’t know the policy about driver removal, but I think both could be removed without upsetting anyone.

synclink_gt.c is still in production and the driver still actively used.

If there are no objections to removing the the old drivers (synclink.c/synclink_mp.c) I could make a patch to do so tomorrow (it is 1:30am here now). Nothing eliminates niggling warnings like removing dead code.









2020-11-05 09:59:25

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On Thu, Nov 05, 2020 at 01:39:36AM -0800, Paul Fulghum wrote:
>
>
> > On Nov 5, 2020, at 1:10 AM, Jiri Slaby <[email protected]> wrote:
> >
> > OK, let the loop alone. I would bet a half a pig that noone is able to test this driver. But one has to write this for someone to raise and admit they are still using it. In fact, there are _4_ google replies to "Microgate Corporation" "SyncLink Multiport Adapter" "lspci".
>
>
>
> The hardware used with synclink.c and synclinkmp.c has not been manufactured for 15 years and was low volume. The chances of either driver still being in use is very low. Not even Microgate (me) has the ability to test either anymore (no hardware). I don’t know the policy about driver removal, but I think both could be removed without upsetting anyone.
>
> synclink_gt.c is still in production and the driver still actively used.
>
> If there are no objections to removing the the old drivers (synclink.c/synclink_mp.c) I could make a patch to do so tomorrow (it is 1:30am here now). Nothing eliminates niggling warnings like removing dead code.

Great, please submit a patch to remove these, I will always take patches
to delete lines :)

thanks,

greg k-h

2020-11-05 10:07:06

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On Thu, 05 Nov 2020, Greg Kroah-Hartman wrote:

> On Thu, Nov 05, 2020 at 01:39:36AM -0800, Paul Fulghum wrote:
> >
> >
> > > On Nov 5, 2020, at 1:10 AM, Jiri Slaby <[email protected]> wrote:
> > >
> > > OK, let the loop alone. I would bet a half a pig that noone is able to test this driver. But one has to write this for someone to raise and admit they are still using it. In fact, there are _4_ google replies to "Microgate Corporation" "SyncLink Multiport Adapter" "lspci".
> >
> >
> >
> > The hardware used with synclink.c and synclinkmp.c has not been
> manufactured for 15 years and was low volume. The chances of either
> driver still being in use is very low. Not even Microgate (me) has
> the ability to test either anymore (no hardware). I don’t know the
> policy about driver removal, but I think both could be removed
> without upsetting anyone.
> >
> > synclink_gt.c is still in production and the driver still actively used.
> >
> > If there are no objections to removing the the old drivers
> > (synclink.c/synclink_mp.c) I could make a patch to do so tomorrow
> > (it is 1:30am here now). Nothing eliminates niggling warnings like
> > removing dead code.
>
> Great, please submit a patch to remove these, I will always take patches
> to delete lines :)

Good resolution. I'm happy to do this. Bear with me.

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

2020-11-05 10:58:33

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On 05. 11. 20, 10:39, Paul Fulghum wrote:
> If there are no objections to removing the the old drivers (synclink.c/synclink_mp.c) I could make a patch to do so tomorrow (it is 1:30am here now). Nothing eliminates niggling warnings like removing dead code.

\o/ Thanks a lot.

--
js
suse labs

2020-11-05 11:07:10

by David Laight

[permalink] [raw]
Subject: RE: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

> >> And the loop can be turned into ndelay:
> >>
> >> /*
> >> * Force at least 170ns delay before clearing
> >> * reset bit. Each read from LCR takes at least
> >> * 30ns so 10 times for 300ns to be safe.
> >> */
> >> for(i=0;i<10;i++)
> >> readval = *MiscCtrl;
> >
> > Again, since I can't test this, I do not want this patch to contain
> > any functional changes. AFAIC, the 10 register reads must still
> > happen after this patch is applied.

You can't use ndelay(); the writes can get posted so can appear
much closer together by the time they get to the actual hardware.
Multiple volatile reads don't need a target variable.
(Shouldn't they also real readl()?)

Deleting the driver works...

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

2020-11-05 11:30:33

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On Thu, 05 Nov 2020, David Laight wrote:

> > >> And the loop can be turned into ndelay:
> > >>
> > >> /*
> > >> * Force at least 170ns delay before clearing
> > >> * reset bit. Each read from LCR takes at least
> > >> * 30ns so 10 times for 300ns to be safe.
> > >> */
> > >> for(i=0;i<10;i++)
> > >> readval = *MiscCtrl;
> > >
> > > Again, since I can't test this, I do not want this patch to contain
> > > any functional changes. AFAIC, the 10 register reads must still
> > > happen after this patch is applied.
>
> You can't use ndelay(); the writes can get posted so can appear
> much closer together by the time they get to the actual hardware.
> Multiple volatile reads don't need a target variable.
> (Shouldn't they also real readl()?)
>
> Deleting the driver works...

Will post the removal patches when my tests finish.

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

2020-11-05 16:12:04

by Jeffrey Hugo

[permalink] [raw]
Subject: Re: [PATCH 20/36] tty: serial: msm_serial: Remove set but unused variable 'status'

On Wed, Nov 4, 2020 at 12:38 PM Lee Jones <[email protected]> wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/serial/msm_serial.c: In function ‘msm_complete_tx_dma’:
> drivers/tty/serial/msm_serial.c:429:18: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
>
> Cc: Andy Gross <[email protected]>
> Cc: Bjorn Andersson <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Robert Love <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Reviewed-by: Jeffrey Hugo <[email protected]>

2020-11-05 16:43:28

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On 05. 11. 20, 12:04, David Laight wrote:
>>>> And the loop can be turned into ndelay:
>>>>
>>>> /*
>>>> * Force at least 170ns delay before clearing
>>>> * reset bit. Each read from LCR takes at least
>>>> * 30ns so 10 times for 300ns to be safe.
>>>> */
>>>> for(i=0;i<10;i++)
>>>> readval = *MiscCtrl;
>>>
>>> Again, since I can't test this, I do not want this patch to contain
>>> any functional changes. AFAIC, the 10 register reads must still
>>> happen after this patch is applied.
>
> You can't use ndelay(); the writes can get posted so can appear
> much closer together by the time they get to the actual hardware.

Ah, indeed, this is on PCI. One read would need to stay before ndelay
then. But given it completely goes away, no need to worry. Thanks for
heads up.

--
js
suse labs

2020-11-05 17:06:26

by Paul Fulghum

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused


Another candidate for removal is drivers/char/pcmcia/synclink_cs.c

Everything I said about synclink.c/synclinkmp.c is true of that as well: the hardware stopped being manufactured decades ago and is not available for testing. The possibility of these cards still being around/functional for use with the latest kernel is about zero.

If Lee Jones does wants to add that to his patch, great. If not then I can do so.

(I resent this message in plain text after it was rejected for HTML, sorry if anyone got a duplicate.)


> On Nov 5, 2020, at 3:27 AM, Lee Jones <[email protected]> wrote:
>
> Will post the removal patches when my tests finish.

2020-11-05 18:09:02

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 27/36] tty: synclinkmp: Mark never checked 'readval' as __always_unused

On Thu, 05 Nov 2020, Paul Fulghum wrote:

>
> Another candidate for removal is drivers/char/pcmcia/synclink_cs.c
>
> Everything I said about synclink.c/synclinkmp.c is true of that as well: the hardware stopped being manufactured decades ago and is not available for testing. The possibility of these cards still being around/functional for use with the latest kernel is about zero.
>
> If Lee Jones does wants to add that to his patch, great. If not then I can do so.

I'll probably send this as a follow-up, as it's easier to get merged
into a different subsystem if they patches are separate and
orthogonal.

Will submit them on the morrow.

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

2020-11-06 08:15:52

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 25/36] tty: serial: sifive: Struct headers should start with 'struct <name>'

On Wed, 04 Nov 2020 11:35:38 PST (-0800), [email protected] wrote:
> Also supply a missing member description.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/serial/sifive.c:157: warning: cannot understand function prototype: 'struct sifive_serial_port '
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Palmer Dabbelt <[email protected]>
> Cc: Paul Walmsley <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/serial/sifive.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
> index 13eadcb8aec4e..1066eebe3b28b 100644
> --- a/drivers/tty/serial/sifive.c
> +++ b/drivers/tty/serial/sifive.c
> @@ -144,12 +144,13 @@
> */
>
> /**
> - * sifive_serial_port - driver-specific data extension to struct uart_port
> + * struct sifive_serial_port - driver-specific data extension to struct uart_port
> * @port: struct uart_port embedded in this struct
> * @dev: struct device *
> * @ier: shadowed copy of the interrupt enable register
> * @clkin_rate: input clock to the UART IP block.
> * @baud_rate: UART serial line rate (e.g., 115200 baud)
> + * @clk: reference to this device's clock
> * @clk_notifier: clock rate change notifier for upstream clock changes
> *
> * Configuration data specific to this SiFive UART.

Reviewed-by: Palmer Dabbelt <[email protected]>
Acked-by: Palmer Dabbelt <[email protected]>

Thanks!

2020-11-06 09:56:15

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Mike Hudson <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/serial/8250/8250_port.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

And now I get build errors of:
ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
make: *** [Makefile:1164: vmlinux] Error 1

Always test-build your patches, perhaps W=1 was wrong here...

thanks,

greg k-h

2020-11-06 09:56:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 00/36] Rid W=1 issues from TTY

On Wed, Nov 04, 2020 at 07:35:13PM +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.

Many of these now applied, please update the series against my
tty-testing branch and resend the rest.

thanks,

greg k-h

2020-11-06 10:09:05

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Cc: Mike Hudson <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> And now I get build errors of:
> ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> make: *** [Makefile:1164: vmlinux] Error 1
>
> Always test-build your patches, perhaps W=1 was wrong here...

I *always* test build my sets before posting.

/investigating

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

2020-11-06 10:19:12

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, 06 Nov 2020, Lee Jones wrote:

> On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
>
> > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > Fixes the following W=1 kernel build warning(s):
> > >
> > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > >
> > > Cc: Greg Kroah-Hartman <[email protected]>
> > > Cc: Jiri Slaby <[email protected]>
> > > Cc: Mike Hudson <[email protected]>
> > > Cc: [email protected]
> > > Signed-off-by: Lee Jones <[email protected]>
> > > ---
> > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > And now I get build errors of:
> > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > make: *** [Makefile:1164: vmlinux] Error 1
> >
>
> I *always* test build my sets before posting.
>
> /investigating

What config failed for you?

It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
be compiled with allmodconfig builds for any architecture that I test
against (Arm, Arm64, MIPS, PPC, x86).

> > perhaps W=1 was wrong here...

NEVER! ;)

The prototype just needs moving is all.

I'll fix the issue and re-post an alternative patch.

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

2020-11-06 10:22:10

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, Nov 06, 2020 at 10:05:52AM +0000, Lee Jones wrote:
> On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
>
> > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > Fixes the following W=1 kernel build warning(s):
> > >
> > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > >
> > > Cc: Greg Kroah-Hartman <[email protected]>
> > > Cc: Jiri Slaby <[email protected]>
> > > Cc: Mike Hudson <[email protected]>
> > > Cc: [email protected]
> > > Signed-off-by: Lee Jones <[email protected]>
> > > ---
> > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > And now I get build errors of:
> > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > make: *** [Makefile:1164: vmlinux] Error 1
> >
> > Always test-build your patches, perhaps W=1 was wrong here...
>
> I *always* test build my sets before posting.

Great, then I should have rephrased it as:
Always test-build your patches and fix the error found in them
before sending.

:)

2020-11-06 10:41:48

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:
> On Fri, 06 Nov 2020, Lee Jones wrote:
>
> > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> >
> > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > Fixes the following W=1 kernel build warning(s):
> > > >
> > > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > >
> > > > Cc: Greg Kroah-Hartman <[email protected]>
> > > > Cc: Jiri Slaby <[email protected]>
> > > > Cc: Mike Hudson <[email protected]>
> > > > Cc: [email protected]
> > > > Signed-off-by: Lee Jones <[email protected]>
> > > > ---
> > > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > And now I get build errors of:
> > > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > make: *** [Makefile:1164: vmlinux] Error 1
> > >
> >
> > I *always* test build my sets before posting.
> >
> > /investigating
>
> What config failed for you?
>
> It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
> be compiled with allmodconfig builds for any architecture that I test
> against (Arm, Arm64, MIPS, PPC, x86).

I build on x86, and here's what I have set:

CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_16550A_VARIANTS=y
CONFIG_SERIAL_8250_FINTEK=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_EXAR=y
CONFIG_SERIAL_8250_NR_UARTS=16
CONFIG_SERIAL_8250_RUNTIME_UARTS=8
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_RSA is not set
CONFIG_SERIAL_8250_DWLIB=y
CONFIG_SERIAL_8250_DW=m
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_8250_UNIPHIER=m
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_8250_TEGRA=m


2020-11-06 10:51:58

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Fri, Nov 06, 2020 at 10:05:52AM +0000, Lee Jones wrote:
> > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> >
> > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > Fixes the following W=1 kernel build warning(s):
> > > >
> > > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > >
> > > > Cc: Greg Kroah-Hartman <[email protected]>
> > > > Cc: Jiri Slaby <[email protected]>
> > > > Cc: Mike Hudson <[email protected]>
> > > > Cc: [email protected]
> > > > Signed-off-by: Lee Jones <[email protected]>
> > > > ---
> > > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > And now I get build errors of:
> > > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > make: *** [Makefile:1164: vmlinux] Error 1
> > >
> > > Always test-build your patches, perhaps W=1 was wrong here...
> >
> > I *always* test build my sets before posting.
>
> Great, then I should have rephrased it as:
> Always test-build your patches and fix the error found in them
> before sending.

Yes, very funny! ;)

Obviously, all of that was implied in my first reply.

The problem is not a lack of testing, it's the testing method.

I thought allmodconfig would be enough, but it appears not.

Currently investigating with allyesconfig as a drop-in replacement.

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

2020-11-06 10:51:58

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:
> > On Fri, 06 Nov 2020, Lee Jones wrote:
> >
> > > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> > >
> > > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > > Fixes the following W=1 kernel build warning(s):
> > > > >
> > > > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > > >
> > > > > Cc: Greg Kroah-Hartman <[email protected]>
> > > > > Cc: Jiri Slaby <[email protected]>
> > > > > Cc: Mike Hudson <[email protected]>
> > > > > Cc: [email protected]
> > > > > Signed-off-by: Lee Jones <[email protected]>
> > > > > ---
> > > > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > And now I get build errors of:
> > > > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > > make: *** [Makefile:1164: vmlinux] Error 1
> > > >
> > >
> > > I *always* test build my sets before posting.
> > >
> > > /investigating
> >
> > What config failed for you?
> >
> > It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
> > be compiled with allmodconfig builds for any architecture that I test
> > against (Arm, Arm64, MIPS, PPC, x86).
>
> I build on x86, and here's what I have set:
>
> CONFIG_SERIAL_EARLYCON=y
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
> CONFIG_SERIAL_8250_PNP=y
> CONFIG_SERIAL_8250_16550A_VARIANTS=y
> CONFIG_SERIAL_8250_FINTEK=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_8250_DMA=y
> CONFIG_SERIAL_8250_PCI=y
> CONFIG_SERIAL_8250_EXAR=y
> CONFIG_SERIAL_8250_NR_UARTS=16
> CONFIG_SERIAL_8250_RUNTIME_UARTS=8
> CONFIG_SERIAL_8250_EXTENDED=y
> # CONFIG_SERIAL_8250_MANY_PORTS is not set
> # CONFIG_SERIAL_8250_SHARE_IRQ is not set
> # CONFIG_SERIAL_8250_DETECT_IRQ is not set
> # CONFIG_SERIAL_8250_RSA is not set
> CONFIG_SERIAL_8250_DWLIB=y
> CONFIG_SERIAL_8250_DW=m
> CONFIG_SERIAL_8250_RT288X=y
> CONFIG_SERIAL_8250_UNIPHIER=m
> CONFIG_SERIAL_8250_LPSS=y
> CONFIG_SERIAL_8250_MID=y
> CONFIG_SERIAL_8250_TEGRA=m

Is that from the default defconfig? Or something bespoke?

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

2020-11-06 10:57:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, Nov 06, 2020 at 10:48:10AM +0000, Lee Jones wrote:
> On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
>
> > On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:
> > > On Fri, 06 Nov 2020, Lee Jones wrote:
> > >
> > > > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> > > >
> > > > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > > > Fixes the following W=1 kernel build warning(s):
> > > > > >
> > > > > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > > > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > > > >
> > > > > > Cc: Greg Kroah-Hartman <[email protected]>
> > > > > > Cc: Jiri Slaby <[email protected]>
> > > > > > Cc: Mike Hudson <[email protected]>
> > > > > > Cc: [email protected]
> > > > > > Signed-off-by: Lee Jones <[email protected]>
> > > > > > ---
> > > > > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > > > >
> > > > > And now I get build errors of:
> > > > > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > > > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > > > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > > > make: *** [Makefile:1164: vmlinux] Error 1
> > > > >
> > > >
> > > > I *always* test build my sets before posting.
> > > >
> > > > /investigating
> > >
> > > What config failed for you?
> > >
> > > It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
> > > be compiled with allmodconfig builds for any architecture that I test
> > > against (Arm, Arm64, MIPS, PPC, x86).
> >
> > I build on x86, and here's what I have set:
> >
> > CONFIG_SERIAL_EARLYCON=y
> > CONFIG_SERIAL_8250=y
> > CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
> > CONFIG_SERIAL_8250_PNP=y
> > CONFIG_SERIAL_8250_16550A_VARIANTS=y
> > CONFIG_SERIAL_8250_FINTEK=y
> > CONFIG_SERIAL_8250_CONSOLE=y
> > CONFIG_SERIAL_8250_DMA=y
> > CONFIG_SERIAL_8250_PCI=y
> > CONFIG_SERIAL_8250_EXAR=y
> > CONFIG_SERIAL_8250_NR_UARTS=16
> > CONFIG_SERIAL_8250_RUNTIME_UARTS=8
> > CONFIG_SERIAL_8250_EXTENDED=y
> > # CONFIG_SERIAL_8250_MANY_PORTS is not set
> > # CONFIG_SERIAL_8250_SHARE_IRQ is not set
> > # CONFIG_SERIAL_8250_DETECT_IRQ is not set
> > # CONFIG_SERIAL_8250_RSA is not set
> > CONFIG_SERIAL_8250_DWLIB=y
> > CONFIG_SERIAL_8250_DW=m
> > CONFIG_SERIAL_8250_RT288X=y
> > CONFIG_SERIAL_8250_UNIPHIER=m
> > CONFIG_SERIAL_8250_LPSS=y
> > CONFIG_SERIAL_8250_MID=y
> > CONFIG_SERIAL_8250_TEGRA=m
>
> Is that from the default defconfig? Or something bespoke?

No idea, bespoke I guess, it's grown over the years as what I use for
testing the tty.git tree. Odd that I have some 8250 options turned off,
no idea why that is...

greg k-h

2020-11-06 11:16:49

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:

> On Fri, Nov 06, 2020 at 10:48:10AM +0000, Lee Jones wrote:
> > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> >
> > > On Fri, Nov 06, 2020 at 10:16:46AM +0000, Lee Jones wrote:
> > > > On Fri, 06 Nov 2020, Lee Jones wrote:
> > > >
> > > > > On Fri, 06 Nov 2020, Greg Kroah-Hartman wrote:
> > > > >
> > > > > > On Wed, Nov 04, 2020 at 07:35:26PM +0000, Lee Jones wrote:
> > > > > > > Fixes the following W=1 kernel build warning(s):
> > > > > > >
> > > > > > > drivers/tty/serial/8250/8250_port.c:349:14: warning: no previous prototype for ‘au_serial_in’ [-Wmissing-prototypes]
> > > > > > > drivers/tty/serial/8250/8250_port.c:359:6: warning: no previous prototype for ‘au_serial_out’ [-Wmissing-prototypes]
> > > > > > >
> > > > > > > Cc: Greg Kroah-Hartman <[email protected]>
> > > > > > > Cc: Jiri Slaby <[email protected]>
> > > > > > > Cc: Mike Hudson <[email protected]>
> > > > > > > Cc: [email protected]
> > > > > > > Signed-off-by: Lee Jones <[email protected]>
> > > > > > > ---
> > > > > > > drivers/tty/serial/8250/8250_port.c | 4 ++--
> > > > > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > > > > >
> > > > > > And now I get build errors of:
> > > > > > ld: drivers/tty/serial/8250/8250_early.o: in function `early_au_setup':
> > > > > > 8250_early.c:(.init.text+0x7): undefined reference to `au_serial_in'
> > > > > > ld: 8250_early.c:(.init.text+0xf): undefined reference to `au_serial_out'
> > > > > > make: *** [Makefile:1164: vmlinux] Error 1
> > > > > >
> > > > >
> > > > > I *always* test build my sets before posting.
> > > > >
> > > > > /investigating
> > > >
> > > > What config failed for you?
> > > >
> > > > It looks as though SERIAL_8250_CONSOLE is a bool and doesn't appear to
> > > > be compiled with allmodconfig builds for any architecture that I test
> > > > against (Arm, Arm64, MIPS, PPC, x86).
> > >
> > > I build on x86, and here's what I have set:
> > >
> > > CONFIG_SERIAL_EARLYCON=y
> > > CONFIG_SERIAL_8250=y
> > > CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
> > > CONFIG_SERIAL_8250_PNP=y
> > > CONFIG_SERIAL_8250_16550A_VARIANTS=y
> > > CONFIG_SERIAL_8250_FINTEK=y
> > > CONFIG_SERIAL_8250_CONSOLE=y
> > > CONFIG_SERIAL_8250_DMA=y
> > > CONFIG_SERIAL_8250_PCI=y
> > > CONFIG_SERIAL_8250_EXAR=y
> > > CONFIG_SERIAL_8250_NR_UARTS=16
> > > CONFIG_SERIAL_8250_RUNTIME_UARTS=8
> > > CONFIG_SERIAL_8250_EXTENDED=y
> > > # CONFIG_SERIAL_8250_MANY_PORTS is not set
> > > # CONFIG_SERIAL_8250_SHARE_IRQ is not set
> > > # CONFIG_SERIAL_8250_DETECT_IRQ is not set
> > > # CONFIG_SERIAL_8250_RSA is not set
> > > CONFIG_SERIAL_8250_DWLIB=y
> > > CONFIG_SERIAL_8250_DW=m
> > > CONFIG_SERIAL_8250_RT288X=y
> > > CONFIG_SERIAL_8250_UNIPHIER=m
> > > CONFIG_SERIAL_8250_LPSS=y
> > > CONFIG_SERIAL_8250_MID=y
> > > CONFIG_SERIAL_8250_TEGRA=m
> >
> > Is that from the default defconfig? Or something bespoke?
>
> No idea, bespoke I guess, it's grown over the years as what I use for
> testing the tty.git tree. Odd that I have some 8250 options turned off,
> no idea why that is...

Not as strange as this.

I cannot recreate the issue or work out why:

# THE OUTPUT
# *_port.o and *_early.o were both built

$ ls -l ../builds/build-x86/drivers/tty/serial/8250/
total 1196
-rw-rw-r-- 1 lee lee 36376 Nov 6 10:52 8250_aspeed_vuart.o
-rw-rw-r-- 1 lee lee 17696 Nov 6 10:52 8250_bcm2835aux.o
-rw-rw-r-- 1 lee lee 90896 Nov 6 10:52 8250_core.o
-rw-rw-r-- 1 lee lee 34184 Nov 6 10:52 8250_dma.o
-rw-rw-r-- 1 lee lee 11840 Nov 6 10:52 8250_dwlib.o
-rw-rw-r-- 1 lee lee 50472 Nov 6 10:52 8250_dw.o
-rw-rw-r-- 1 lee lee 16496 Nov 6 10:52 8250_early.o
-rw-rw-r-- 1 lee lee 49376 Nov 6 10:52 8250_exar.o
-rw-rw-r-- 1 lee lee 20256 Nov 6 10:52 8250_fintek.o
-rw-rw-r-- 1 lee lee 26976 Nov 6 10:52 8250_ingenic.o
-rw-rw-r-- 1 lee lee 18904 Nov 6 10:52 8250_lpc18xx.o
-rw-rw-r-- 1 lee lee 21712 Nov 6 10:52 8250_lpss.o
-rw-rw-r-- 1 lee lee 18768 Nov 6 10:52 8250_men_mcb.o
-rw-rw-r-- 1 lee lee 25880 Nov 6 10:52 8250_mid.o
-rw-rw-r-- 1 lee lee 30880 Nov 6 10:52 8250_of.o
-rw-rw-r-- 1 lee lee 142776 Nov 6 10:52 8250_pci.o
-rw-rw-r-- 1 lee lee 23240 Nov 6 10:52 8250_pnp.o
-rw-rw-r-- 1 lee lee 214088 Nov 6 10:52 8250_port.o
-rw-rw-r-- 1 lee lee 18992 Nov 6 10:52 8250_tegra.o
-rw-rw-r-- 1 lee lee 23736 Nov 6 10:52 8250_uniphier.o
-rw-rw-r-- 1 lee lee 1626 Nov 6 10:52 built-in.a
-rw-rw-r-- 1 lee lee 0 Nov 6 10:52 modules.order
-rw-rw-r-- 1 lee lee 94280 Nov 6 10:52 serial_cs.o

# THE BUILD

locally noclean x86 w1 drivers/tty debug

Running locally

********************
* Building for X86 *
********************

rm -rf ../builds/build-x86/drivers/tty/

make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 allyesconfig
make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 W=1 drivers/tty/

make[1]: Entering directory '/home/lee/projects/linux/builds/build-x86'
SYNC include/config/auto.conf.cmd
GEN Makefile
GEN Makefile
DESCEND objtool
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
CC drivers/tty/tty_io.o
CC drivers/tty/n_tty.o
CC drivers/tty/tty_ioctl.o
CC drivers/tty/tty_ldisc.o
CC drivers/tty/tty_buffer.o
CC drivers/tty/tty_port.o
CC drivers/tty/vt/vt_ioctl.o
CC drivers/tty/tty_mutex.o
CC drivers/tty/hvc/hvc_console.o
CC drivers/tty/vt/selection.o
CC drivers/tty/vt/vc_screen.o
CC drivers/tty/hvc/hvc_irq.o
CC drivers/tty/ipwireless/hardware.o
CC drivers/tty/serdev/core.o
CC drivers/tty/tty_ldsem.o
CC drivers/tty/vt/keyboard.o
CC drivers/tty/serdev/serdev-ttyport.o
CC drivers/tty/hvc/hvc_xen.o
CC drivers/tty/tty_baudrate.o
CC drivers/tty/ipwireless/main.o
CC drivers/tty/serial/serial_core.o
CC drivers/tty/serial/8250/8250_core.o
CC drivers/tty/serial/8250/8250_pnp.o
CC drivers/tty/serial/jsm/jsm_driver.o
CC drivers/tty/ipwireless/network.o
CC drivers/tty/ipwireless/tty.o
CC drivers/tty/serial/8250/8250_port.o
CC drivers/tty/vt/consolemap.o
CC drivers/tty/serial/jsm/jsm_neo.o
CC drivers/tty/serial/8250/8250_dma.o
HOSTCC drivers/tty/vt/conmakehash
CC drivers/tty/tty_jobctrl.o
CC drivers/tty/n_null.o
CC drivers/tty/serial/8250/8250_dwlib.o
CC drivers/tty/vt/vt.o
AR drivers/tty/ipwireless/built-in.a
CC drivers/tty/serial/jsm/jsm_tty.o
CC drivers/tty/serial/jsm/jsm_cls.o
CC drivers/tty/serial/earlycon.o
CC drivers/tty/pty.o
SHIPPED drivers/tty/vt/defkeymap.c
CC drivers/tty/tty_audit.o
CC drivers/tty/vt/defkeymap.o
CONMK drivers/tty/vt/consolemap_deftbl.c
CC drivers/tty/vt/consolemap_deftbl.o
CC drivers/tty/serial/clps711x.o
CC drivers/tty/serial/8250/8250_fintek.o
AR drivers/tty/serial/jsm/built-in.a
AR drivers/tty/hvc/built-in.a
CC drivers/tty/serial/bcm63xx_uart.o
CC drivers/tty/serial/8250/8250_pci.o
CC drivers/tty/serial/samsung_tty.o
CC drivers/tty/serial/8250/8250_exar.o
CC drivers/tty/serial/max3100.o
CC drivers/tty/serial/max310x.o
CC drivers/tty/serial/lpc32xx_hs.o
AR drivers/tty/serdev/built-in.a
CC drivers/tty/serial/8250/serial_cs.o
CC drivers/tty/serial/8250/8250_aspeed_vuart.o
CC drivers/tty/sysrq.o
CC drivers/tty/n_hdlc.o
CC drivers/tty/n_gsm.o
CC drivers/tty/n_tracerouter.o
CC drivers/tty/n_tracesink.o
CC drivers/tty/serial/8250/8250_bcm2835aux.o
CC drivers/tty/serial/sh-sci.o
CC drivers/tty/cyclades.o
CC drivers/tty/serial/imx.o
CC drivers/tty/serial/imx_earlycon.o
CC drivers/tty/serial/8250/8250_early.o
CC drivers/tty/serial/8250/8250_men_mcb.o
CC drivers/tty/isicom.o
CC drivers/tty/moxa.o
CC drivers/tty/serial/8250/8250_dw.o
AR drivers/tty/vt/built-in.a
CC drivers/tty/mxser.o
CC drivers/tty/serial/sccnxp.o
CC drivers/tty/serial/8250/8250_lpc18xx.o
CC drivers/tty/serial/sc16is7xx.o
CC drivers/tty/serial/8250/8250_uniphier.o
CC drivers/tty/serial/atmel_serial.o
CC drivers/tty/serial/uartlite.o
CC drivers/tty/serial/8250/8250_ingenic.o
CC drivers/tty/serial/qcom_geni_serial.o
CC drivers/tty/serial/8250/8250_lpss.o
CC drivers/tty/serial/8250/8250_mid.o
CC drivers/tty/nozomi.o
CC drivers/tty/ttynull.o
CC drivers/tty/rocket.o
CC drivers/tty/synclink_gt.o
CC drivers/tty/serial/8250/8250_tegra.o
CC drivers/tty/serial/8250/8250_of.o
CC drivers/tty/goldfish.o
CC drivers/tty/serial/altera_uart.o
CC drivers/tty/serial/st-asc.o
CC drivers/tty/serial/ucc_uart.o
CC drivers/tty/serial/timbuart.o
CC drivers/tty/serial/altera_jtaguart.o
CC drivers/tty/serial/ifx6x60.o
CC drivers/tty/serial/pch_uart.o
CC drivers/tty/serial/mxs-auart.o
CC drivers/tty/serial/lantiq.o
AR drivers/tty/serial/8250/built-in.a
CC drivers/tty/serial/xilinx_uartps.o
CC drivers/tty/serial/arc_uart.o
CC drivers/tty/serial/rp2.o
CC drivers/tty/serial/fsl_lpuart.o
CC drivers/tty/serial/fsl_linflexuart.o
CC drivers/tty/serial/digicolor-usart.o
CC drivers/tty/serial/men_z135_uart.o
CC drivers/tty/serial/sprd_serial.o
CC drivers/tty/serial/stm32-usart.o
CC drivers/tty/serial/mvebu-uart.o
CC drivers/tty/serial/mps2-uart.o
CC drivers/tty/serial/owl-uart.o
CC drivers/tty/serial/rda-uart.o
CC drivers/tty/serial/milbeaut_usio.o
CC drivers/tty/serial/sifive.o
CC drivers/tty/serial/serial_mctrl_gpio.o
CC drivers/tty/serial/kgdb_nmi.o
CC drivers/tty/serial/kgdboc.o
AR drivers/tty/serial/built-in.a
AR drivers/tty/built-in.a
make[1]: Leaving directory '/home/lee/projects/linux/builds/build-x86'

******************************
* Checking for SPARSE errors *
******************************

make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 C=1 W=1 drivers/tty/

make[1]: Entering directory '/home/lee/projects/linux/builds/build-x86'
GEN Makefile
DESCEND objtool
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
make[1]: Leaving directory '/home/lee/projects/linux/builds/build-x86'

******************************
* Checking for SMATCH errors *
* TODO: stdout => stderr *
******************************

make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86 C=1 CHECK='smatch --no-data -p=kernel' W=1 drivers/tty/

make[1]: Entering directory '/home/lee/projects/linux/builds/build-x86'
GEN Makefile
DESCEND objtool
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
make[1]: Leaving directory '/home/lee/projects/linux/builds/build-x86'

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

2020-11-06 11:21:55

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On 06. 11. 20, 12:12, Lee Jones wrote:
> I cannot recreate the issue or work out why:
>
> # THE OUTPUT
> # *_port.o and *_early.o were both built
You have to _link_ to see linker errors ;).

Like make vmlinux


--
js

2020-11-06 14:50:17

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 13/36] tty: serial: 8250: 8250_port: Staticify functions referenced by pointers

On Fri, 06 Nov 2020, Jiri Slaby wrote:

> On 06. 11. 20, 12:12, Lee Jones wrote:
> > I cannot recreate the issue or work out why:
> >
> > # THE OUTPUT
> > # *_port.o and *_early.o were both built

> You have to _link_ to see linker errors ;).
>
> Like make vmlinux

The default make that I am using does link:

make -f Makefile -j24 KBUILD_OUTPUT=../builds/build-x86

But I do see what's happening now (thanks for the nudge).

The issue is being masked because I'm specifying a specific directory
to build. I would have hoped that it would at least link into a
subsystem type object file, but it looks as though it's only being
*-ar'ed into an archive.

It appears linking is only done once at the very end of the compile,
which is kind of frustrating for my use-case.

This confused me because I know that I'd received linking errors
before. However this must have been for files compiled as modules
(these are linked on-the-fly) rather than built-ins, which are only
linked once everything else has finished.

Not sure how I'm going to fix this yet, since compiling everything is
very time consuming, but I'll work something out.

Thanks again.

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

2020-11-16 11:29:07

by Maarten Brock

[permalink] [raw]
Subject: Re: [PATCH 22/36] tty: serial: xilinx_uartps: Supply description for missing member 'cts_override'

On 2020-11-04 20:35, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/tty/serial/xilinx_uartps.c:205: warning: Function parameter
> or member 'cts_override' not described in 'cdns_uart'
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Jiri Slaby <[email protected]>
> Cc: Michal Simek <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/tty/serial/xilinx_uartps.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/tty/serial/xilinx_uartps.c
> b/drivers/tty/serial/xilinx_uartps.c
> index a9b1ee27183a7..a14c5d9964739 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -192,6 +192,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
> * @baud: Current baud rate
> * @clk_rate_change_nb: Notifier block for clock changes
> * @quirks: Flags for RXBS support.
> + * @cts_override: Modem control state override
> */
> struct cdns_uart {
> struct uart_port *port;

While you are at it, would you consider to also fix the indentation of
the
cts_override flag at line 208?

Maarten

2020-11-16 12:43:40

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 22/36] tty: serial: xilinx_uartps: Supply description for missing member 'cts_override'

On Mon, 16 Nov 2020, Maarten Brock wrote:

> On 2020-11-04 20:35, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/tty/serial/xilinx_uartps.c:205: warning: Function parameter
> > or member 'cts_override' not described in 'cdns_uart'
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Jiri Slaby <[email protected]>
> > Cc: Michal Simek <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/tty/serial/xilinx_uartps.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/tty/serial/xilinx_uartps.c
> > b/drivers/tty/serial/xilinx_uartps.c
> > index a9b1ee27183a7..a14c5d9964739 100644
> > --- a/drivers/tty/serial/xilinx_uartps.c
> > +++ b/drivers/tty/serial/xilinx_uartps.c
> > @@ -192,6 +192,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
> > * @baud: Current baud rate
> > * @clk_rate_change_nb: Notifier block for clock changes
> > * @quirks: Flags for RXBS support.
> > + * @cts_override: Modem control state override
> > */
> > struct cdns_uart {
> > struct uart_port *port;
>
> While you are at it, would you consider to also fix the indentation of the
> cts_override flag at line 208?

This set has already been merged sadly.

Please feel free to submit a patch of your own.

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

2020-11-27 07:01:32

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 31/36] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location

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

drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
385 | void __init hvc_vio_init_early(void)
| ^~~~~~~~~~~~~~~~~~

Cc: Michael Ellerman <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
Acked-by: Michael Ellerman <[email protected]>
---

v2:
- Removed 'extern' keyword

arch/powerpc/include/asm/hvconsole.h | 3 +++
arch/powerpc/platforms/pseries/pseries.h | 3 ---
arch/powerpc/platforms/pseries/setup.c | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/hvconsole.h b/arch/powerpc/include/asm/hvconsole.h
index 999ed5ac90531..ccb2034506f0f 100644
--- a/arch/powerpc/include/asm/hvconsole.h
+++ b/arch/powerpc/include/asm/hvconsole.h
@@ -24,5 +24,8 @@
extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);

+/* Provided by HVC VIO */
+void hvc_vio_init_early(void);
+
#endif /* __KERNEL__ */
#endif /* _PPC64_HVCONSOLE_H */
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 593840847cd3d..693f58d784b5b 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -43,9 +43,6 @@ extern void pSeries_final_fixup(void);
/* Poweron flag used for enabling auto ups restart */
extern unsigned long rtas_poweron_auto;

-/* Provided by HVC VIO */
-extern void hvc_vio_init_early(void);
-
/* Dynamic logical Partitioning/Mobility */
extern void dlpar_free_cc_nodes(struct device_node *);
extern void dlpar_free_cc_property(struct property *);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 090c13f6c8815..b5513eefd12c9 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -71,6 +71,7 @@
#include <asm/swiotlb.h>
#include <asm/svm.h>
#include <asm/dtl.h>
+#include <asm/hvconsole.h>

#include "pseries.h"
#include "../../../../drivers/pci/pci.h"
--
2.25.1