lkml.org 
[lkml]   [2023]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/6] tty: serial: amba-pl011: replace TIOCMBIT macros by static functions
On Thu, Oct 26, 2023 at 12:41 PM Théo Lebrun <theo.lebrun@bootlin.com> wrote:

> 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.
>
> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>

The kernel looks better after this patch than before, so:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Since the eternal defines uses masks rather than bits we can't
use __set_bit() & friends in this case and that's life.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2023-10-26 15:47    [W:1.284 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site