summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* n_hdlc: add helper for buffers allocationJiri Slaby2020-02-211-22/+20
| | | | | | | | | | Given both rx and tx allocations do the same, add a new helper (n_hdlc_alloc_buf) and use it for both of them. This cleans up n_hdlc_alloc slightly. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-15-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: remove checking of n_hdlcJiri Slaby2020-02-211-29/+3
| | | | | | | | | | | | | We got rid of backup_tty recently. Also, the tty layer ensures not to call other ldisc hooks after ldisc close. That means, all those tests are superfluous now so remove them. Note that we remove the magic check in write after schedule too. The tty cannot change during schedule. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-14-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: remove cached ttyJiri Slaby2020-02-211-16/+5
| | | | | | | | | It's not needed, as now it's clear, that it's always the same as the one passed from the tty layer. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-13-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: inline n_hdlc_releaseJiri Slaby2020-02-211-25/+10
| | | | | | | | | | | | Put the body of n_hdlc_release into the only caller. It can be seen, that the "if" is superfluous now -- the same happens few lines above in n_hdlc_tty_close already. So drop it. Drop also n_hdlc2tty macro as this was the only user. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-12-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: expand tty2n_hdlc macroJiri Slaby2020-02-211-12/+11
| | | | | | | | | It's simple tty->disc_data, but it obfuscates code. So expand it to all locations and drop it. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: remove unused backup_ttyJiri Slaby2020-02-211-9/+1
| | | | | | | | It's only set to NULL and never properly used. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: remove unused flagsJiri Slaby2020-02-211-4/+1
| | | | | | | | They are only set to 0 and never read. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: invert conditions in n_hdlc_tty_close and n_hdlc_tty_pollJiri Slaby2020-02-211-34/+38
| | | | | | | | | | | | This makes the functions return immediatelly on invalid state. And we can push the indent of the later code one level left. Pass "-w" to "git show" to see we are changing only the conditions (and whitespace). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: simplify freeing of buffer listJiri Slaby2020-02-211-31/+14
| | | | | | | | | | | | | n_hdlc_release contains four loops to free each buffer list. Create a helper (n_hdlc_free_buf_list) and call it for every list instead. It makes n_hdlc_release more readable. We are switching from "for (;;)" to "do {} while (buf)" which avoids the "if (buf)" completely -- kfree is a nop for NULL pointers. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: use clamp() for maxframeJiri Slaby2020-02-211-4/+1
| | | | | | | | | It is easier to read. And use MAX_HDLC_FRAME_SIZE instead of magic constant. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: cleanup messages during registrationJiri Slaby2020-02-211-4/+4
| | | | | | | | | | 1) n_hdlc prints two lines during registration. Squeeze it into one. 2) prefix the error message with "N_HDLC: ", so that it's clear which ldisc failed to register. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: put init/exit strings directly to printsJiri Slaby2020-02-211-22/+6
| | | | | | | | | | | | | | | | | | These strings were put aside from prints to save some bytes after module load or when built-in -- they were freed after module load (__init ones) or when the driver is selected as built-in (__exit ones). The savings are negligible, but the code readability is worse by the order of magnitude. So put the strings where they belong. Note that it also used to make little sense putting const data in .data (the __exit case). While at it, switch to pr_info, pr_err, not using the KERN_INFO and _ERR directly. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: convert debuglevel use to pr_debugJiri Slaby2020-02-211-48/+31
| | | | | | | | | | | | | | | With pr_debug we have a fine-grained control about debugging prints. So convert the use of global debuglevel variable and tests to a commonly used pr_debug. And drop debuglevel completely. This also implicitly adds a loglevel to the messages (KERN_DEBUG) as it was missing on most of them. And also use __func__ instead of function names explicitly typed. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: remove unused macrosJiri Slaby2020-02-211-5/+0
| | | | | | | | VERSION and bset are unused. Remove them. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_hdlc: remove tracing debug printsJiri Slaby2020-02-211-30/+2
| | | | | | | | | | | | We can trace functions using ftrace, so there is no need for this additional prints. Remove them. We keep only those which print some additional info, not only function name & "entry"/"exit". Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084118.26491-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: samsung_tty: remove SERIAL_SAMSUNG_DEBUGGreg Kroah-Hartman2020-02-201-9/+0
| | | | | | | | | | | | | | | | | | | | Since a05025d0ce72 ("tty: serial: samsung_tty: use standard debugging macros") this configuration option is not used at all, so remove it from the Kconfig file. Cc: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: Jiri Slaby <jslaby@suse.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Hyunki Koo <kkoos00@naver.com> Cc: Donghoon Yu <hoony.yu@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200220102628.3371996-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: samsung_tty: build it for any platformGreg Kroah-Hartman2020-02-201-1/+0
| | | | | | | | | | | | | | | | | | | There is no need to tie this driver to only a specific SoC, or compile test, so remove that dependancy from the Kconfig rules. Cc: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: Jiri Slaby <jslaby@suse.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Hyunki Koo <kkoos00@naver.com> Cc: Donghoon Yu <hoony.yu@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200220102628.3371996-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: switch escape to boolJiri Slaby2020-02-191-3/+3
| | | | | | | | gsm_mux->escape is used as a bool, so treat it as such. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: switch constipated to boolJiri Slaby2020-02-191-6/+6
| | | | | | | | | Both gsm_dlci->constipated and gsm_mux->constipated are used as bools, so treat them as such. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: switch throttled to boolJiri Slaby2020-02-191-3/+3
| | | | | | | | gsm_dlci->throttled is used as a bool, so treat it as such. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: switch dead to boolJiri Slaby2020-02-191-9/+9
| | | | | | | | | Both gsm_dlci->dead and gsm_mux->dead are used as bools, so treat them as such. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: add missing \n to printsJiri Slaby2020-02-191-4/+4
| | | | | | Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: add missing __user annotationsJiri Slaby2020-02-191-2/+2
| | | | | | | | | | | | | sparse warns about incorrect types: n_gsm.c:2638:35: warning: incorrect type in argument 1 (different address spaces) n_gsm.c:2638:35: expected void [noderef] <asn:1> *to n_gsm.c:2638:35: got void * The ioctl handler casts its `arg' to (void *) without __user. Add that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: introduce enum gsm_mux_stateJiri Slaby2020-02-191-12/+21
| | | | | | | | | | | | | | gsm_mux->state is clearly an enumeration. So introduce one and use it -- compiler now checks if valid values are assigned to the field. Note that a compiler warns about unhandled cases in switch. Add default cases with a pr_debug (which is not printed by default). The values of the states are preserved thanks to the nature of enum. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: introduce enum gsm_dlci_modeJiri Slaby2020-02-191-3/+6
| | | | | | | | | gsm_dlci->mode is clearly an enumeration. So introduce one and use it -- compiler now checks if valid values are assigned to the field. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: introduce enum gsm_dlci_stateJiri Slaby2020-02-191-5/+15
| | | | | | | | | | | | gsm_dlci->state is clearly an enumeration. So introduce one and use it -- compiler now checks if valid values are assigned to the field. Note that a compiler warns about unhandled cases in switch. Add default cases with a pr_debug (which is not printed by default). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_gsm: drop unneeded gsm_dlci->fifo fieldJiri Slaby2020-02-191-12/+10
| | | | | | | | | gsm_dlci->fifo always points to gsm_dlci->_fifo. So drop the pointer and rename _fifo to fifo. And update all the users (add & to them). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: 8250_port: Use dev_*() instead of pr_*()Andy Shevchenko2020-02-191-10/+7
| | | | | | | | | Convert pr_*() calls to dev_*() ones. We have a port, we should use it. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200217114016.49856-5-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: 8250_port: Switch to use DEVICE_ATTR_RW()Andy Shevchenko2020-02-191-8/+6
| | | | | | | | | | Move device attributes to DEVICE_ATTR_RW() as that would make things a lot more "obvious" what is happening here. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200217114016.49856-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: efm32: fix spelling mistake "reserverd" -> "reserved"Alexandre Belloni2020-02-191-1/+1
| | | | | | | | | Fix a spelling mistake in a comment. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20200214141406.20792-1-alexandre.belloni@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: serial: Kconfig: Fix a typoChristophe JAILLET2020-02-191-1/+1
| | | | | | | | 'exsisting' has an extra 's' Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/20200216102742.19298-1-christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: 8250_pxa: avoid autodetecting the port typeLubomir Rintel2020-02-191-1/+1
| | | | | | | | | | | | | If we're unlucky enough that this drivers binds to a mrvl,mmp-uart device on a MMP3, the port type gets detected as 16550A instead of XScale, and it won't work. Other drivers that may bind to the same hardware are 8250_of and, god forbid, serial_pxa. Force the port type, we know it's a PORT_XSCALE. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20200219080130.4334-1-lkundrak@v3.sk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: core: Switch to use DEVICE_ATTR_RO()Andy Shevchenko2020-02-171-29/+28
| | | | | | | | | | Move device attributes to DEVICE_ATTR_RO() as that would make things a lot more "obvious" what is happening here. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200217114016.49856-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: core: use octal permissions on module paramAndy Shevchenko2020-02-141-13/+13
| | | | | | | | | Symbolic permissions 'S_IRUSR | S_IRGRP' are not preferred. Use octal permissions '0440'. This also makes code shorter. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200214114339.53897-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: core: Consolidate spin lock initialization codeAndy Shevchenko2020-02-141-18/+16
| | | | | | | | | We have two times duplicated excerpt where we initialize spin lock for UART port. Consolidate it under uart_port_spin_lock_init() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200214114339.53897-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: core: Introduce uart_console_enabled() helperAndy Shevchenko2020-02-141-2/+7
| | | | | | | | | | | Introduce uart_console_enabled() helper which checks port to be console and console is registered in the list. Note, this helper will be used in the future as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200214114339.53897-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: 8250_pci: Replace zero-length array with flexible-array memberGustavo A. R. Silva2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200213004426.GA7886@embeddedor.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: sc16is7xx: Replace zero-length array with flexible-array memberGustavo A. R. Silva2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200213004611.GA8748@embeddedor.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: n_gsm: Replace zero-length array with flexible-array memberGustavo A. R. Silva2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertenly introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200212193523.GA28826@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty/serial: 8250_exar: Replace zero-length array with flexible-array memberGustavo A. R. Silva2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertenly introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200212193700.GA29715@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: 8250_early: Add earlycon for BCM2835 aux uartMatthias Brugger2020-02-101-0/+18
| | | | | | | | | | Define the OF early console for BCM2835 aux UART, which can be enabled by passing "earlycon" on the boot command line. This UART is found on BCM283x and BCM27xx SoCs, a.k.a. Raspberry Pi in its variants. Signed-off-by: Matthias Brugger <mbrugger@suse.com> Link: https://lore.kernel.org/r/20200126123314.3558-1-matthias.bgg@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* serial: 8250_tegra: Create Tegra specific 8250 driverJeff Brasen2020-02-104-28/+208
| | | | | | | | | | | | | To support booting NVIDIA Tegra platforms with either Device-Tree or ACPI, create a Tegra specific 8250 serial driver that supports both firmware types. Another benefit from doing this, is that the Tegra specific codec in the generic Open Firmware 8250 driver can now be removed. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200129132817.26343-1-jonathanh@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* n_tty: check printk arguments for n_tty_traceJiri Slaby2020-02-101-1/+1
| | | | | | | | | When N_TTY_TRACE is undefined (the default), define n_tty_trace to use no_printk. That way, arguments are still checked during compilation. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200130115843.7452-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* kgdboc: Use for_each_console() helperAndy Shevchenko2020-02-101-3/+1
| | | | | | | | | | Replace open coded single-linked list iteration loop with for_each_console() helper in use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20200124161132.65519-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Linux 5.6-rc1v5.6-rc1Linus Torvalds2020-02-101-2/+2
|
* Merge tag 'kbuild-v5.6-2' of ↵Linus Torvalds2020-02-1053-261/+252
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - fix randconfig to generate a sane .config - rename hostprogs-y / always to hostprogs / always-y, which are more natual syntax. - optimize scripts/kallsyms - fix yes2modconfig and mod2yesconfig - make multiple directory targets ('make foo/ bar/') work * tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: make multiple directory targets work kconfig: Invalidate all symbols after changing to y or m. kallsyms: fix type of kallsyms_token_table[] scripts/kallsyms: change table to store (strcut sym_entry *) scripts/kallsyms: rename local variables in read_symbol() kbuild: rename hostprogs-y/always to hostprogs/always-y kbuild: fix the document to use extra-y for vmlinux.lds kconfig: fix broken dependency in randconfig-generated .config
| * kbuild: make multiple directory targets workMasahiro Yamada2020-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the single-target build does not work when two or more sub-directories are given: $ make fs/ kernel/ lib/ CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh DESCEND objtool make[2]: Nothing to be done for 'kernel/'. make[2]: Nothing to be done for 'fs/'. make[2]: Nothing to be done for 'lib/'. Make it work properly. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
| * kconfig: Invalidate all symbols after changing to y or m.Tetsuo Handa2020-02-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | Since commit 89b9060987d9 ("kconfig: Add yes2modconfig and mod2yesconfig targets.") forgot to clear SYMBOL_VALID bit after changing to y or m, these targets did not save the changes. Call sym_clear_all_valid() so that all symbols are revalidated. Fixes: 89b9060987d9 ("kconfig: Add yes2modconfig and mod2yesconfig targets.") Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
| * kallsyms: fix type of kallsyms_token_table[]Masahiro Yamada2020-02-051-2/+3
| | | | | | | | | | | | | | | | kallsyms_token_table[] only contains ASCII characters. It should be char instead of u8. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
| * scripts/kallsyms: change table to store (strcut sym_entry *)Masahiro Yamada2020-02-031-56/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | The symbol table is extended every 10000 addition by using realloc(), where data copy might occur to the new buffer. To decrease the amount of possible data copy, let's change the table to store the pointer. The symbol type + symbol name part is appended at the end of (struct sym_entry), and allocated together with the struct body. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>