- 26 Apr, 2022 14 commits
-
-
Ilpo Järvinen authored
8250 DMA tx complete path lacks calls to normal 8250 stop handling. It does not use THRE to detect true completion of the tx and also doesn't call __stop_tx. This leads to problems with em485 that needs to handle RTS timing. Instead of handling tx stop internally within 8250 dma code, enable THRE when tx'able data runs out and tweak serial8250_handle_irq to call only __stop_tx when uart is using DMA. It also seems bit early to call serial8250_rpm_put_tx from there while tx is still underway(?). Tested-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20220425143410.12703-3-ilpo.jarvinen@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ilpo Järvinen authored
Struct uart_port currently stores FIFO timeout. Having character timing information readily available is useful. Even serial core itself determines char_time from port->timeout using inverse calculation. Store frame_time directly into uart_port. Character time is stored in nanoseconds to have reasonable precision with high rates. To avoid overflow, 64-bit math is necessary. It might be possible to determine timeout from frame_time by multiplying it with fifosize as needed but only part of the users seem to be protected by a lock. Thus, this patch does not pursue storing only frame_time in uart_port. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20220425143410.12703-2-ilpo.jarvinen@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Phil Edworthy authored
Renesas RZ/N1 SoC features a slightly modified DW UART. On this SoC, the CPR register value is known but not synthetized in hardware. We hence need to provide a CPR value in the platform data. This version of the controller also relies on acting as flow controller when using DMA, so we need to provide the "is dma flow controller" quirk. Co-developed-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-10-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Phil Edworthy authored
DW based controllers like the one on Renesas RZ/N1 must be programmed as flow controllers when using DMA. * Table 11.45 of the system manual, "Flow Control Combinations", states that using UART with DMA requires setting the DMA in the peripheral flow controller mode regardless of the direction. * Chapter 11.6.1.3 of the system manual, "Basic Interface Definitions", explains that the burst size in the above case must be configured in the peripheral's register DEST/SRC_BURST_SIZE. Experiments shown that upon Rx timeout, the DMA transaction needed to be manually cleared as well. Co-developed-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-9-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Miquel Raynal authored
These accessors should be used instead of the regular readl/writel() helpers. In order to use them also from 8250_dw.c in this directory, move the helpers to 8250_dwlib.h There is no functional change. There is no need for declaring `struct uart_port` or even UPIO_MEM32BE which both are already included in the 8250_dwlib.h header by 8250.h. Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-8-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Miquel Raynal authored
In a next change we are going to need the same Rx timeout condition as we already have in the IRQ handling code. Let's just create a boolean to clarify what this operation does before reusing it. There is no functional change. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-7-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Miquel Raynal authored
One situation where this could be used is when configuring the UART controller to be the DMA flow controller. This is a typical case where the driver might need to program a few more registers before starting a DMA transfer. Provide the necessary infrastructure to support this case. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-6-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Miquel Raynal authored
DW UART controllers can be synthesized without the CPR register. In this case, allow to the platform information to provide a CPR value. Co-developed-by: Phil Edworthy <phil.edworthy@renesas.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-5-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Miquel Raynal authored
This offset is a good candidate to pdata's because it changes depending on the vendor implementation. Let's move the usr_reg entry from regular to pdata. This way we can drop initializing it at run time. Let's also use a define for it instead of defining only the default value. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-4-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Emil Renner Berthing authored
Use device tree match data rather than multiple calls to of_device_is_compatible() by introducing a platform data structure and adding a quirks mask. Provide a stub to the compatibles without quirks to simplify the handling of the upcoming changes. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk> [<miquel.raynal@bootlin.com: Minor changes + creation of a real pdata structure] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-3-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Phil Edworthy authored
Move the per-device structure and a helper out of the main .c file, into a shared header as they will both be reused from another .c file. There is no functional change. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> [miquel.raynal@bootlin.com: Extracted from a bigger change] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-2-miquel.raynal@bootlin.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Changbin Du authored
The backtrace of current CPU also should be printed as it is active. This change add stack trace for current CPU and print a hint for idle CPU for the generic workqueue based printing. (x86 already does this) Now it looks like below: [ 279.401567] sysrq: Show backtrace of all active CPUs [ 279.407234] sysrq: CPU5: [ 279.407505] Call Trace: [ 279.408789] [<ffffffff8000606c>] dump_backtrace+0x2c/0x3a [ 279.411698] [<ffffffff800060ac>] show_stack+0x32/0x3e [ 279.411809] [<ffffffff80542258>] sysrq_handle_showallcpus+0x4c/0xc6 [ 279.411929] [<ffffffff80542f16>] __handle_sysrq+0x106/0x26c [ 279.412034] [<ffffffff805436a8>] write_sysrq_trigger+0x64/0x74 [ 279.412139] [<ffffffff8029cd48>] proc_reg_write+0x8e/0xe2 [ 279.412252] [<ffffffff8021a8f8>] vfs_write+0x90/0x2be [ 279.412362] [<ffffffff8021acd2>] ksys_write+0xa6/0xce [ 279.412467] [<ffffffff8021ad24>] sys_write+0x2a/0x38 [ 279.412689] [<ffffffff80003ff8>] ret_from_syscall+0x0/0x2 [ 279.417173] sysrq: CPU6: backtrace skipped as idling [ 279.417185] sysrq: CPU4: backtrace skipped as idling [ 279.417187] sysrq: CPU0: backtrace skipped as idling [ 279.417181] sysrq: CPU7: backtrace skipped as idling [ 279.417190] sysrq: CPU1: backtrace skipped as idling [ 279.417193] sysrq: CPU3: backtrace skipped as idling [ 279.417219] sysrq: CPU2: [ 279.419179] Call Trace: [ 279.419440] [<ffffffff8000606c>] dump_backtrace+0x2c/0x3a [ 279.419782] [<ffffffff800060ac>] show_stack+0x32/0x3e [ 279.420015] [<ffffffff80542b30>] showacpu+0x5c/0x96 [ 279.420317] [<ffffffff800ba71c>] flush_smp_call_function_queue+0xd6/0x218 [ 279.420569] [<ffffffff800bb438>] generic_smp_call_function_single_interrupt+0x14/0x1c [ 279.420798] [<ffffffff800079ae>] handle_IPI+0xaa/0x13a [ 279.421024] [<ffffffff804dcb92>] riscv_intc_irq+0x56/0x70 [ 279.421274] [<ffffffff80a05b70>] generic_handle_arch_irq+0x6a/0xfa [ 279.421518] [<ffffffff80004006>] ret_from_exception+0x0/0x10 [ 279.421750] [<ffffffff80096492>] rcu_idle_enter+0x16/0x1e Signed-off-by: Changbin Du <changbin.du@gmail.com> Link: https://lore.kernel.org/r/20220117154300.2808-1-changbin.du@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wan Jiabing authored
Use if and else instead of if(A) and if (!A) and fix a coding style. Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20220424091310.98780-1-wanjiabing@vivo.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wan Jiabing authored
Use if and else instead of if(A) and if (!A). Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20220426071041.168282-1-wanjiabing@vivo.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 22 Apr, 2022 26 commits
-
-
Valentin Caron authored
Add early console support in stm32 uart driver. Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com> Link: https://lore.kernel.org/r/20220419085330.1178925-4-valentin.caron@foss.st.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valentin Caron authored
Add support for KGDB in stm32 serial driver by implementing characters polling callbacks (poll_init, poll_get_char and poll_put_char). Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com> Signed-off-by: Jean Philippe Romain <jean-philippe.romain@foss.st.com> Signed-off-by: Valentin Caron <valentin.caron@foss.st.com> Link: https://lore.kernel.org/r/20220419085330.1178925-3-valentin.caron@foss.st.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Valentin Caron authored
Rework stm32_usart_console_putchar() function in order to anticipate the case where the character can never be sent. Signed-off-by: Valentin Caron <valentin.caron@foss.st.com> Link: https://lore.kernel.org/r/20220419085330.1178925-2-valentin.caron@foss.st.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ilpo Järvinen authored
Move receive path flow control character handling to own function. No functional changes. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20220411094859.10894-2-ilpo.jarvinen@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tomasz Moń authored
Do not set timeout to twice the approximate amount of time to send the entire FIFO if CTS is enabled. If the caller requested no timeout, e.g. when userspace program called tcdrain(), then wait without any timeout. Premature return from tcdrain() was observed on imx based system which has 32 character long transmitter FIFO with hardware CTS handling. Simple userspace application that reproduces problem has to: * Open tty device, enable hardware flow control (CRTSCTS) * Write data, e.g. 26 bytes * Call tcdrain() to wait for the transmitter * Close tty device The other side of serial connection has to: * Receive some data, e.g. 10 bytes * Set RTS output (CTS input from sender perspective) inactive for at least twice the port timeout * Try to receive remaining data Without this patch, userspace application will finish without any error while the other side of connection will never receive remaining data. Signed-off-by: Tomasz Moń <tomasz.mon@camlingroup.com> Link: https://lore.kernel.org/r/20220228054911.1420221-1-tomasz.mon@camlingroup.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vincent Whitchurch authored
Register a console in the ttyprintk driver so that it can be selected for /dev/console with console=ttyprintk on the kernel command line, similar to other console drivers. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Link: https://lore.kernel.org/r/20220215141750.92808-1-vincent.whitchurch@axis.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wander Lairson Costa authored
Note: I am using a small test app + driver located at [0] for the problem description. serco is a driver whose write function dispatches to the serial controller. sertest is a user-mode app that writes n bytes to the serial console using the serco driver. While investigating a bug in the RHEL kernel, I noticed that the serial console throughput is way below the configured speed of 115200 bps in a HP Proliant DL380 Gen9. I was expecting something above 10KB/s, but I got 2.5KB/s. $ time ./sertest -n 2500 /tmp/serco real 0m0.997s user 0m0.000s sys 0m0.997s With the help of the function tracer, I then noticed the serial controller was taking around 410us seconds to dispatch one single byte: $ trace-cmd record -p function_graph -g serial8250_console_write \ ./sertest -n 1 /tmp/serco $ trace-cmd report | serial8250_console_write() { 0.384 us | _raw_spin_lock_irqsave(); 1.836 us | io_serial_in(); 1.667 us | io_serial_out(); | uart_console_write() { | serial8250_console_putchar() { | wait_for_xmitr() { 1.870 us | io_serial_in(); 2.238 us | } 1.737 us | io_serial_out(); 4.318 us | } 4.675 us | } | wait_for_xmitr() { 1.635 us | io_serial_in(); | __const_udelay() { 1.125 us | delay_tsc(); 1.429 us | } ... ... ... 1.683 us | io_serial_in(); | __const_udelay() { 1.248 us | delay_tsc(); 1.486 us | } 1.671 us | io_serial_in(); 411.342 us | } In another machine, I measured a throughput of 11.5KB/s, with the serial controller taking between 80-90us to send each byte. That matches the expected throughput for a configuration of 115200 bps. This patch changes the serial8250_console_write to use the 16550 fifo if available. In my benchmarks I got around 25% improvement in the slow machine, and no performance penalty in the fast machine. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20220411174841.34936-2-wander@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Duoming Zhou authored
There is a deadlock in sa1100_set_termios(), which is shown below: (Thread 1) | (Thread 2) | sa1100_enable_ms() sa1100_set_termios() | mod_timer() spin_lock_irqsave() //(1) | (wait a time) ... | sa1100_timeout() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold sport->port.lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need sport->port.lock in position (2) of thread 2. As a result, sa1100_set_termios() will block forever. This patch moves del_timer_sync() before spin_lock_irqsave() in order to prevent the deadlock. Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Link: https://lore.kernel.org/r/20220417111626.7802-1-duoming@zju.edu.cnSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Junwen Wu authored
The definition of sysrq_key_table's elements, like sysrq_thaw_op and sysrq_showallcpus_op are not consistent with sysrq_ftrace_dump_op, Consistency makes code more readable. Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Junwen Wu <wudaemon@gmail.com> Link: https://lore.kernel.org/r/20220418153703.97705-1-wudaemon@163.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Sherry Sun authored
No need to initialize the count variable in lpuart_copy_rx_to_tty(), so let's remove it here. Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20220418021844.29591-1-sherry.sun@nxp.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Some more serial drivers can be compile-tested under certain circumstances (when building a specific architecture). So allow for that. This reduces the need of zillion mach/subarch-specific configs. And since the 0day bot has only allmodconfig's for some archs, this increases build coverage there too. Note that cpm needs a minor update in the header, so that it drags in at least some defines (CPM2 ones). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421101708.5640-8-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
pic32_uart contains this: #ifdef CONFIG_SERIAL_PIC32_CONSOLE ... console_initcall(pic32_console_init); ... core_initcall(pic32_late_console_init); ... #endif ... arch_initcall(pic32_uart_init); When the driver is built as module, all three above become module_init(). So if SERIAL_PIC32_CONSOLE is set while SERIAL_PIC32=m, it results in the following build error: In file included from include/linux/device/driver.h:21, from include/linux/device.h:32, from include/linux/platform_device.h:13, from drivers/tty/serial/pic32_uart.c:12: include/linux/module.h:131:49: error: redefinition of '__inittest' So make sure SERIAL_PIC32_CONSOLE can be set only when SERIAL_PIC32=y -- similar as for other drivers. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421101708.5640-7-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
The code wants to know if the circ buffer is empty, so use the proper macro. No functional change intended, just saner function name used for that use case. Cc: Andy Gross <agross@kernel.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421101708.5640-6-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
struct uart_port::membase is declared as a pointer. So it should be initialized by NULL, not zero constant. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421101708.5640-5-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Cache port->state->xmit into a local variable (xmit) in cdns_uart_handle_tx(). This reduces length of some lines there significantly. I.e. makes the code more readable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421101708.5640-4-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Return from the true branch of the 'if'. This saves one indentation level and makes the code more readable. The two comments about what obvious code does are removed too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421101708.5640-3-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tom Rix authored
Smatch reports this issue sunplus-uart.c:501:26: warning: symbol 'sunplus_console_ports' was not declared. Should it be static? sunplus_console_ports is only used in sunplus-uart.c so change its storage-class specifier to static Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20220421152505.1531507-1-trix@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yu Tu authored
Make UART driver compatible with S4 SOC UART. Meanwhile, the S4 SOC UART uses 12MHz as the clock source for baud rate calculations. Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Yu Tu <yu.tu@amlogic.com> Link: https://lore.kernel.org/r/20220422111320.19234-3-yu.tu@amlogic.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yu Tu authored
tty: serial: meson: Add a 12MHz internal clock rate to calculate baud rate in order to meet the baud rate requirements of special BT modules A /2 divider over XTAL was introduced since G12A, and is preferred to be used over the still present /3 divider since it provides much closer frequencies vs the request baudrate. Especially the BT module uses 3Mhz baud rate. 8Mhz calculations can lead to baud rate bias, causing some problems. Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Yu Tu <yu.tu@amlogic.com> Link: https://lore.kernel.org/r/20220422111320.19234-2-yu.tu@amlogic.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Some members of struct icom_port are completely unused or only set and never read. Remove all those. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-11-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
uart_ops::release_port() and uart_ops::request_port() are not required by the serial layer. So no need to define empty ones. Remove them. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-10-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Use list_for_each_entry() helper instead of explicit combo of list_for_each() and list_entry(). Note that pos is used as a reference point in list_add_tail() in icom_alloc_adapter(). This functionality remains as with an empty list, cur_adapter_entry->icom_adapter_entry is still the list head. This simplifies the code a bit. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-9-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
The baud rates are unsigned constants. So mark them as such. Not only it makes sense, but they are passed also to uart_get_baud_rate() and that expects unsigned int as baud rates on input. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-8-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-7-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
There is no point keeping the header content separated. The header was not even protected against double inclusion. So move the content to the appropriate source file. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-6-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jiri Slaby authored
There is a lot of sparse warnings: .../icom.c:228:30: warning: cast from restricted __le16 .../icom.c:232:66: warning: incorrect type in assignment (different base types) .../icom.c:232:66: expected unsigned int [usertype] leBuffer .../icom.c:232:66: got restricted __le32 [usertype] .../icom.c:237:30: warning: cast from restricted __le16 ... .../icom.c:1228:22: warning: cast from restricted __le16 And they are correct. So sort them all out by using proper __leXX and uXX types and the right direction of conversion: le16_to_cpu() instead of cpu_to_le16(), where appropriate. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20220421085808.24152-5-jslaby@suse.czSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-