qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com,
	bmeng@tinylab.org, liwei1518@gmail.com,
	zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com,
	alex.bennee@linaro.org, philmd@linaro.org, mjt@tls.msk.ru,
	ajones@ventanamicro.com
Subject: Re: [PATCH 2/2] checkpatch.pl: forbid strerrorname_np()
Date: Wed, 24 Apr 2024 11:52:33 +0200	[thread overview]
Message-ID: <488595a9-8302-413e-9b54-081492533804@redhat.com> (raw)
In-Reply-To: <20240424094700.453356-3-dbarboza@ventanamicro.com>

On 24/04/2024 11.47, Daniel Henrique Barboza wrote:
> Commit d424db2354 removed an instance of strerrorname_np() because it
> was breaking building with musl libc. A recent RISC-V patch ended up
> re-introducing it again by accident.
> 
> Put this function in the baddies list in checkpatch.pl to avoid this
> situation again. This is what it will look like next time:
> 
>   $ ./scripts/checkpatch.pl 0001-temp-test.patch
>   ERROR: use strerror() instead of strerrorname_np()
>   #22: FILE: target/riscv/kvm/kvm-cpu.c:1058:
>   +                         strerrorname_np(errno));
> 
>   total: 1 errors, 0 warnings, 10 lines checked
> 
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
>   scripts/checkpatch.pl | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 7026895074..be0982246d 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3056,6 +3056,10 @@ sub process {
>   		}
>   	}
>   
> +	if ($line =~ /\bstrerrorname_np\(/) {
> +		ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr);
> +	}
> +
>   # check for non-portable libc calls that have portable alternatives in QEMU
>   		if ($line =~ /\bffs\(/) {
>   			ERROR("use ctz32() instead of ffs()\n" . $herecurr);

Reviewed-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2024-04-24  9:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  9:46 [PATCH 0/2] riscv,kvm: remove another strerrorname_np() Daniel Henrique Barboza
2024-04-24  9:46 ` [PATCH 1/2] target/riscv/kvm: remove sneaky strerrorname_np() instance Daniel Henrique Barboza
2024-04-24  9:51   ` Thomas Huth
2024-04-24  9:55   ` Philippe Mathieu-Daudé
2024-04-24 17:18     ` Daniel Henrique Barboza
2024-04-24 17:54       ` Philippe Mathieu-Daudé
2024-04-24  9:47 ` [PATCH 2/2] checkpatch.pl: forbid strerrorname_np() Daniel Henrique Barboza
2024-04-24  9:52   ` Thomas Huth [this message]
2024-04-24  9:57   ` Philippe Mathieu-Daudé
2024-04-24  9:58 ` [PATCH 0/2] riscv,kvm: remove another strerrorname_np() Philippe Mathieu-Daudé

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=488595a9-8302-413e-9b54-081492533804@redhat.com \
    --to=thuth@redhat.com \
    --cc=ajones@ventanamicro.com \
    --cc=alex.bennee@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liwei1518@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=palmer@rivosinc.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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;
as well as URLs for NNTP newsgroup(s).