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: <CAMuHMdXi4ieMvZY1J8RjuOeR+vKrTmASq-40MK27xutZPv4deQ@mail.gmail.com>
Date:   Thu, 13 Feb 2020 09:26:19 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     Mark Brown <broonie@...nel.org>,
        linux-spi <linux-spi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] spi: spidev_test: Check input_tx and input_file first
 after parse options

Hi Tiezhu,

On Thu, Feb 13, 2020 at 5:17 AM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
> It is better to check input_tx and input_file first after parse options.
> Otherwise, it will do some useless operations when both -p and --input
> are selected.
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>

> --- a/tools/spi/spidev_test.c
> +++ b/tools/spi/spidev_test.c
> @@ -404,6 +404,9 @@ int main(int argc, char *argv[])
>
>         parse_opts(argc, argv);
>
> +       if (input_tx && input_file)
> +               pabort("only one of -p and --input may be selected");
> +

Alternatively, this check could be moved to the end of parse_opts().

>         fd = open(device, O_RDWR);
>         if (fd < 0)
>                 pabort("can't open device");

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