[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZRW6Evzr+CWuhpz6hinfAnwXaEp4GG=9+zY6yJy14xmw@mail.gmail.com>
Date: Thu, 26 Oct 2023 15:46:18 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Théo Lebrun <theo.lebrun@...tlin.com>
Cc: Russell King <linux@...linux.org.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
Gregory CLEMENT <gregory.clement@...tlin.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>,
Tawfik Bayouk <tawfik.bayouk@...ileye.com>
Subject: Re: [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@...tlin.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@...tlin.com>
The kernel looks better after this patch than before, so:
Reviewed-by: Linus Walleij <linus.walleij@...aro.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
Powered by blists - more mailing lists