summaryrefslogtreecommitdiffstats
path: root/drivers/tty
AgeCommit message (Collapse)Author
2020-11-06serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warningYueHaibing
drivers/tty/serial/serial_mctrl_gpio.c:214 mctrl_gpio_init() warn: passing zero to 'ERR_PTR' gpiod_to_irq() never return 0, so remove the useless test and make code more clear. Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20201031030530.1304-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: Remove redundant synclinkmp driverLee Jones
A note from the vendor: "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." Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201105123357.708813-3-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: Remove redundant synclink driverLee Jones
A note from the vendor: "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." Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201105123357.708813-2-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: remove pnx8xxx uart driverThomas Bogendoerfer
Commit 625326ea9c84 ("MIPS: Remove PNX833x alias NXP_STB22x") removed support for PNX833x, so it's time to remove serial driver, too. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://lore.kernel.org/r/20201106130332.103476-1-tsbogend@alpha.franken.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: synclink: Provide missing description for 'hdlcdev_tx_timeout's ↵Lee Jones
'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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: paulkf@microgate.com Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-37-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: hvc: hvc_opal: Staticify function invoked by referenceLee Jones
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 <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-34-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: hvc: hvc_vio: Staticify function invoked only by referenceLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-33-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: serial-tegra: Provide some missing struct member descriptionsLee Jones
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 <ldewangan@nvidia.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: "Christian König" <christian.koenig@amd.com> Cc: linux-serial@vger.kernel.org Cc: linux-tegra@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-31-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_ldisc: Supply missing description for 'tty_ldisc_get's 'tty' paramLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-30-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: stm32-usart: Remove set but unused 'cookie' variablesLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Gerald Baeza <gerald.baeza@st.com> Cc: linux-serial@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-29-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: synclinkmp: Add missing description for function param 'txqueue'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: paulkf@microgate.com Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-27-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: sifive: Struct headers should start with 'struct <name>'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: linux-serial@vger.kernel.org Cc: linux-riscv@lists.infradead.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com> Link: https://lore.kernel.org/r/20201104193549.4026187-26-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: serial-tegra: Struct headers should start with 'struct <name>'Lee Jones
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 <ldewangan@nvidia.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: "Christian König" <christian.koenig@amd.com> Cc: linux-serial@vger.kernel.org Cc: linux-tegra@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-25-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: synclink_gt: Demote one kernel-doc header and repair anotherLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: paulkf@microgate.com Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-24-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: xilinx_uartps: Supply description for missing member 'cts_override'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Michal Simek <michal.simek@xilinx.com> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-23-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: ifx6x60: Fix function documentation headersLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Filip Aben <f.aben@option.com> Cc: Joseph Barrow <d.barow@option.com> Cc: Jan Dumon <j.dumon@option.com> Cc: Russ Gorby <russ.gorby@intel.com> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-22-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: msm_serial: Remove set but unused variable 'status'Lee Jones
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 <agross@kernel.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Robert Love <rlove@google.com> Cc: linux-arm-msm@vger.kernel.org Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Link: https://lore.kernel.org/r/20201104193549.4026187-21-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: lpc32xx_hs: Remove unused variable 'tmp'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Sylvain Lemieux <slemieux.tyco@gmail.com> Cc: Kevin Wells <kevin.wells@nxp.com> Cc: Roland Stigge <stigge@antcom.de> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Link: https://lore.kernel.org/r/20201104193549.4026187-20-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: n_gsm: Demote obvious abuse of kernel-doc and supply other missing docssLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-19-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: amba-pl011: Mark 'sbsa_uart_acpi_match' as __maybe_unusedLee Jones
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 <linux@armlinux.org.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-18-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: pty: Provide descriptions for the 'file' parametersLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: "C. Scott Ananian" <cananian@alumni.princeton.edu> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-17-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_audit: Demote non-conformant kernel-doc headersLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Miloslav Trmac <mitr@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-16-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: 8250: serial_cs: Remove unused/unchecked variable 'err'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Colin Ian King <colin.king@canonical.com> Cc: "David A. Hinds" <dahinds@users.sourceforge.net> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-15-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_io: Fix some kernel-doc issuesLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Nick Holloway <alfie@dcs.warwick.ac.uk> Cc: -- <julian@uhunix.uhcc.hawaii.edu> Cc: Marko Kohtala <Marko.Kohtala@hut.fi> Cc: Bill Hawes <whawes@star.net> Cc: "C. Scott Ananian" <cananian@alumni.princeton.edu> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Andrew Morton <andrewm@uow.edu.eu> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-13-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serial: jsm: jsm_cls: Remove unused variable 'discard'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-12-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: n_tty: Add 2 missing parameter descriptionsLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: "Andrew J. Kroll" <ag784@freenet.buffalo.edu> Cc: processes-Sapan Bhatia <sapan@corewars.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-11-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: vt: consolemap: Demote weakly documented function headerLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Jakub Jelinek <jj@ultra.linux.cz> Cc: Stanislav Voronyi <stas@cnti.uanet.kharkov.ua> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-10-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_jobctrl: Add missing function parameter descriptionsLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-8-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_port: Demote obvious abuse of kernel-doc formattingLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-7-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_buffer: Add missing description for 'limit'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-6-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_io: Move 'tty_sysctl_init's prototype to shared spaceLee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Nick Holloway <alfie@dcs.warwick.ac.uk> Cc: -- <julian@uhunix.uhcc.hawaii.edu> Cc: Marko Kohtala <Marko.Kohtala@hut.fi> Cc: Bill Hawes <whawes@star.net> Cc: "C. Scott Ananian" <cananian@alumni.princeton.edu> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Andrew Morton <andrewm@uow.edu.eu> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-5-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: tty_baudrate: Add missing description for 'tty'Lee Jones
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 <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-4-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serdev: core: Provide missing description for 'owner'Lee Jones
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 <robh@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-3-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06tty: serdev: core: Remove unused variable 'dummy'Lee Jones
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 <robh@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: linux-serial@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104193549.4026187-2-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, use tty_insert_flip_string in puts_queueJiri Slaby
'puts_queue' currently loops over characters and employs the full tty buffer machinery for every character. Do the buffer allocation only once and copy all the character at once. This is achieved using tty_insert_flip_string instead of loop+tty_insert_flip_char. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-17-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, use find_next_bit in kbd_matchJiri Slaby
Instead of a 'for' loop with 'test_bit's to find a bit in a range, use find_next_bit to achieve the same in a simpler and faster manner. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-16-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, make HW_RAW a functionJiri Slaby
Instead of a multiline macro, convert HW_RAW to an inline function. It allows for type checking of the parameter. And given we split the code into two tests, it is now more readable too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-15-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, union perm checks in vt_do_kdgkb_ioctlJiri Slaby
Do the permission check on a single place. That is where perm is really checked. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-14-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, extract and simplify vt_kdskbsentJiri Slaby
Setting of function key strings is now very complex. It uses a global buffer 'func_buf' which is prefilled in defkeymap.c_shipped. Then there is also an index table called 'func_table'. So initially, we have something like this: char func_buf[] = "\e[[A\0" // for F1 "\e[[B\0" // for F2 ...; char *func_table[] = { func_buf + 0, // for F1 func_buf + 5, // for F2 ... } When a user changes some specific func string by KDSKBSENT, it is changed in 'func_buf'. If it is shorter or equal to the current one, it is handled by a very quick 'strcpy'. When the user's string is longer, the whole 'func_buf' is reallocated to allow expansion somewhere in the middle. The buffer before the user's string is copied, the user's string appended and the rest appended too. Now, the index table (func_table) needs to be recomputed, of course. One more complication is the held spinlock -- we have to unlock, reallocate, lock again and do the whole thing again to be sure noone raced with us. In this patch, we chose completely orthogonal approach: when the user's string is longer than the current one, we simply assign the 'kstrdup'ed copy to the index table (func_table) and modify func_buf in no way. We only need to make sure we free the old entries. So we need a bitmap is_kmalloc and free the old entries (but not the original func_buf rodata string). Also note that we do not waste so much space as previous approach. We only allocate space for single entries which are longer, while before, the whole buffer was duplicated plus space for the longer string. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-12-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, reorder user buffer handling in vt_do_kdgkb_ioctlJiri Slaby
KDGKBSENT (the getter) needs only 'user_kdgkb->kb_func' from the userspace, i.e. the index. Then it needs a buffer for a local copy of 'kb_string'. KDSKBSENT (the setter) needs a copy up to the length of 'user_kdgkb->kb_string'. That means, we obtain the index before the switch-case and use it in both paths and: 1) allocate full space in the getter case, and 2) copy the string only in the setter case. We do it by strndup_user helper now which was not available when this function was written. Given we copy the two members of 'struct kbsentry' separately, we no longer need a local definition. Hence we need to change all the sizeofs here too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, rename i to kb_func in vt_do_kdgkb_ioctlJiri Slaby
There are too many one-letter variables in vt_do_kdgkb_ioctl which is rather confusing. Rename 'i' to 'kb_func' and change its type to be the same as its originating value (struct kbsentry.kb_func) -- unsigned char. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, use bool for repJiri Slaby
rep is used as a bool in the code, so declare it as such. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, use DECLARE_BITMAP for key_downJiri Slaby
key_down is sued as a bitmap using test_bit, set_bit and similar. So declare it using DECLARE_BITMAP to make it obvious even from the declaration. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, union perm checks in vt_do_kdsk_ioctlJiri Slaby
Do the permission check on a single place. That is where perm is really checked. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, extract vt_kdgkbent and vt_kdskbentJiri Slaby
Split vt_do_kdsk_ioctl into three functions: * getter (KDGKBENT/vt_kdgkbent) * setter (KDSKBENT/vt_kdskbent) * switch-case helper (vt_do_kdsk_ioctl) This eliminates the need of ugly one-letter macros as we use parameters now: * i aka tmp.kb_index -> idx * s aka tmp.kb_table -> map * v aka tmp.kb_value -> val Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, clean up max_valsJiri Slaby
Define one limit per line and index them by their index, so that it is clear what is what. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, sort includesJiri Slaby
There are many includes and it is hard to check if something is there or not. So sort them alphabetically. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, include linux/spinlock.hJiri Slaby
We use spin locks, but don't include linux/spinlock.h in keyboards.c. So fix this up. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04vt: keyboard, remove ctrl_alt_del declarationJiri Slaby
ctrl_alt_del is already declared in linux/reboot.h which we include. So remove this second (superfluous) declaration. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20201029113222.32640-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04Merge 5.10-rc2 into tty-nextGreg Kroah-Hartman
We need the tty/vt/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>