diff options
author | Théo Lebrun <theo.lebrun@bootlin.com> | 2023-12-07 20:56:08 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-15 16:24:12 +0300 |
commit | dc00f0cc5e04490416d4c2164011e39b4a2d29df (patch) | |
tree | 78edd97a767f4ea27308854c424937f2afb673ee /tools/perf/scripts/python/export-to-postgresql.py | |
parent | d93ebe0fcfbd29e2b93850b5f66f98b0d63cce9c (diff) | |
download | linux-dc00f0cc5e04490416d4c2164011e39b4a2d29df.tar.xz |
tty: serial: amba-pl011: replace TIOCMBIT macros by static functions
The driver uses two TIOCMBIT macros inside pl011_{get,set}_mctrl to
simplify the logic. Those look scary to checkpatch because they contain
ifs without do-while loops.
Avoid the macros by creating small equivalent static functions; that
lets the compiler do its type checking & avoids checkpatch errors.
For the second instance __assign_bit is not usable because it deals with
unsigned long pointers whereas we have an unsigned int in
pl011_set_mctrl.
This addresses the following checkpatch warnings:
$ ./scripts/checkpatch.pl --strict --file \
drivers/tty/serial/amba-pl011.c
ERROR: Macros starting with if should be enclosed by a do -
while loop to avoid possible if/else logic defects
CHECK: Macro argument 'uartbit' may be better as '(uartbit)' to
avoid precedence issues
ERROR: Macros starting with if should be enclosed by a do - while
loop to avoid possible if/else logic defects
CHECK: Macro argument 'tiocmbit' may be better as '(tiocmbit)' to
avoid precedence issues
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20231207-mbly-uart-v6-3-e384afa5e78c@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions