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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXi0x+VrJO8V_qU8dw+WrzBGqsz_m+nfT7uYWgcUwyUqA@mail.gmail.com>
Date:   Mon, 4 Jan 2021 11:18:30 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     chensong_2000@....cn
Cc:     Greg KH <greg@...ah.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Ian Abbott <abbotti@....co.uk>,
        H Hartley Sweeten <hsweeten@...ionengravers.com>
Subject: Re: [PATCH v2] staging: board: Remove macro board_staging

Hi Chen,

Thanks for your patch!

On Mon, Jan 4, 2021 at 9:55 AM Song Chen <chensong_2000@....cn> wrote:
> Macro is not supposed to have flow control in it's
> statement, remove.

Why not?

>
> Signed-off-by: Song Chen <chensong_2000@....cn>
>
> ---
> Changes in v2:
> 1, kzm9d_init and armadillo800eva_init are not compatible
> with the definition of device_initcall, fixed.
> ---
>  drivers/staging/board/armadillo800eva.c | 15 ++++++++++-----
>  drivers/staging/board/board.h           | 11 -----------
>  drivers/staging/board/kzm9d.c           | 23 ++++++++++++++---------
>  3 files changed, 24 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c
> index 0225234..9896c7ba 100644
> --- a/drivers/staging/board/armadillo800eva.c
> +++ b/drivers/staging/board/armadillo800eva.c
> @@ -78,11 +78,16 @@ static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
>         },
>  };
>
> -static void __init armadillo800eva_init(void)
> +static int __init armadillo800eva_init(void)
>  {
> -       board_staging_gic_setup_xlate("arm,pl390", 32);
> -       board_staging_register_devices(armadillo800eva_devices,
> -                                      ARRAY_SIZE(armadillo800eva_devices));
> +       if (of_machine_is_compatible("renesas,armadillo800eva")) {
> +               board_staging_gic_setup_xlate("arm,pl390", 32);
> +               board_staging_register_devices(armadillo800eva_devices,
> +                                              ARRAY_SIZE(armadillo800eva_devices));
> +               return 0;
> +       }
> +
> +       return -ENODEV;
>  }
>
> -board_staging("renesas,armadillo800eva", armadillo800eva_init);
> +device_initcall(armadillo800eva_init);

This change makes it more difficult to have multiple entries sharing
the same init function.  See also the various *OF_DECLARE() macros.

Note that a similar patch was (IMHO rightfully) rejected 3 years ago:
https://lore.kernel.org/lkml/20170220175506.GA30142@kroah.com/

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