lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdW=8zBgY-Nsq2W99X1XCn8v17w5mScFixVOr8vrDpEEvg@mail.gmail.com>
Date:   Mon, 5 Dec 2022 09:52:19 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Joe Peterson <jwp.linux@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: board: Remove control flow from macro

Hi Joe,

On Sat, Dec 3, 2022 at 4:08 AM Joe Peterson <jwp.linux@...il.com> wrote:
> Adhere to Linux coding style
>
> Reported by checkpatch:
>
> WARNING: Macros with flow control statements should be avoided
>
> There is only one return value possible. Remove the checkpatch warning
> without effecting functionality.
>
> Signed-off-by: Joe Peterson <jwp.linux@...il.com>

Thanks for your patch!
But please try to compile it before submission.

> --- a/drivers/staging/board/board.h
> +++ b/drivers/staging/board/board.h
> @@ -33,12 +33,10 @@ void board_staging_register_devices(const struct board_staging_dev *devs,
>                                     unsigned int ndevs);
>
>  #define board_staging(str, fn)                 \
> -static int __init runtime_board_check(void)    \
> +static void __init runtime_board_check(void)   \

device_initcalls must adhere to the initcall_t signature, regardless
what checkpatch says, cfr. include/linux/init.h:

    typedef int (*initcall_t)(void);

>  {                                              \
>         if (of_machine_is_compatible(str))      \
>                 fn();                           \
> -                                               \
> -       return 0;                               \
>  }                                              \
>                                                 \
>  device_initcall(runtime_board_check)


Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ