From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [PATCH 3/4] spi: spidev_test: Use perror() only if errno is not 0 Date: Thu, 13 Feb 2020 09:27:52 +0100 Message-ID: References: <1581567368-8055-1-git-send-email-yangtiezhu@loongson.cn> <1581567368-8055-3-git-send-email-yangtiezhu@loongson.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Mark Brown , linux-spi , Linux Kernel Mailing List To: Tiezhu Yang Return-path: In-Reply-To: <1581567368-8055-3-git-send-email-yangtiezhu-cXZgJK919ebM1kAEIRd3EQ@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: On Thu, Feb 13, 2020 at 5:17 AM Tiezhu Yang wrote: > It is better to use perror() only if errno is not 0, it should use printf() > when errno is 0, otherwise there exists redudant ": Success". > > E.g. without this patch: > > $ ./spidev_test -p 1234 --input test.bin > only one of -p and --input may be selected: Success > Aborted (core dumped) > > With this patch: > > $ ./spidev_test -p 1234 --input test.bin > only one of -p and --input may be selected > Aborted (core dumped) > > Signed-off-by: Tiezhu Yang Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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