[PATCH 25/26] Input: maplecontrol - fix style issues

Adrian McMenamin adrianmcmenamin at gmail.com
Sun Jul 5 12:28:39 PDT 2026


On Sat, 4 Jul 2026 at 06:58, Dmitry Torokhov <dmitry.torokhov at gmail.com> wrote:
>
> Fix coding style and formatting issues reported by checkpatch.pl and
> switch to using BIT(). When reporting D-PAD events avoid conditionals.
>
> Assisted-by: Antigravity:gemini-3.5-flash
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov at gmail.com>
> ---
>  drivers/input/joystick/maplecontrol.c | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c
> index 3ef6652d40cb..457a73d91239 100644
> --- a/drivers/input/joystick/maplecontrol.c
> +++ b/drivers/input/joystick/maplecontrol.c
> @@ -35,22 +35,22 @@ static void dc_pad_callback(struct mapleq *mq)
>         buttons = ~le16_to_cpup((__le16 *)(res + 8));
>
>         input_report_abs(dev, ABS_HAT0Y,
> -               (buttons & 0x0010 ? -1 : 0) + (buttons & 0x0020 ? 1 : 0));
> +                        !!(buttons & BIT(5)) - !!(buttons & BIT(4)));
>         input_report_abs(dev, ABS_HAT0X,
> -               (buttons & 0x0040 ? -1 : 0) + (buttons & 0x0080 ? 1 : 0));
> +                        !!(buttons & BIT(7)) - !!(buttons & BIT(6)));


Maybe I have missed something but what is this !! operator?

Adrian



More information about the linux-mtd mailing list