qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
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,
	thuth@redhat.com, alex.bennee@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:57:20 +0200	[thread overview]
Message-ID: <14fbd0a8-de17-4686-9304-ea384a094828@linaro.org> (raw)
In-Reply-To: <20240424094700.453356-3-dbarboza@ventanamicro.com>

On 24/4/24 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

This should be added here in the "non-portable libc calls" section.

>   		if ($line =~ /\bffs\(/) {
>   			ERROR("use ctz32() instead of ffs()\n" . $herecurr);



  parent reply	other threads:[~2024-04-24  9:57 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
2024-04-24  9:57   ` Philippe Mathieu-Daudé [this message]
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=14fbd0a8-de17-4686-9304-ea384a094828@linaro.org \
    --to=philmd@linaro.org \
    --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=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=thuth@redhat.com \
    --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).