mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Joe Perches <joe@perches.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: sibyte: pointless if tests
Date: Wed, 28 Feb 2024 12:52:11 +0100	[thread overview]
Message-ID: <d44026e7-5ffa-4906-9b59-10fa207ecd51@linaro.org> (raw)
In-Reply-To: <2cf0b77f51b907969ae83993854773961b4e159c.camel@perches.com>

On 24/2/24 23:28, Joe Perches wrote:
> A checkpatch modification was suggested privately about
> braces around an if test like
> 
> 	if (foo)
> 		;
> 
> so I thought I'd see how many of these possibly pointless
> if tests exist.  There aren't many.
> 
> Here are a couple in sibyte:
> 
> Maybe this should be documented as:
> 
> 	"well, don't know what to do here"

Or pr_devel() / pr_warn() if you want someone to notice it :)

> 
> $ cat if_semi.cocci
> @@
> expression e;
> @@
> 
> *	if (e) ;
> 
> $ spatch --very-quiet -sp-file if_semi.cocci .
> diff -u -p ./arch/mips/sibyte/common/cfe_console.c /tmp/nothing/arch/mips/sibyte/common/cfe_console.c
> --- ./arch/mips/sibyte/common/cfe_console.c
> +++ /tmp/nothing/arch/mips/sibyte/common/cfe_console.c
> @@ -22,8 +22,6 @@ static void cfe_console_write(struct con
>   		if (str[i] == '\n') {
>   			do {
>   				written = cfe_write(cfe_cons_handle, &str[last], i-last);
> -				if (written < 0)
> -					;
>   				last += written;
>   			} while (last < i);
>   			while (cfe_write(cfe_cons_handle, "\r", 1) <= 0)
> @@ -33,8 +31,6 @@ static void cfe_console_write(struct con
>   	if (last != count) {
>   		do {
>   			written = cfe_write(cfe_cons_handle, &str[last], count-last);
> -			if (written < 0)
> -				;
>   			last += written;
>   		} while (last < count);
>   	}
> 


  reply	other threads:[~2024-02-28 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24 22:28 Joe Perches
2024-02-28 11:52 ` Philippe Mathieu-Daudé [this message]
2024-05-14 23:49 ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d44026e7-5ffa-4906-9b59-10fa207ecd51@linaro.org \
    --to=philmd@linaro.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®