All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, lersek@redhat.com, famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] checkpatch: volatile with a comment or sig_atomic_t is okay
Date: Mon, 18 Dec 2017 08:07:21 -0500 (EST)	[thread overview]
Message-ID: <167321084.622468.1513602441314.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20171218130309.2682-1-pbonzini@redhat.com>

Hi

----- Original Message -----
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> This assumes that the comment gives some justification;
> "volatile sig_atomic_t" is also self-explanatory and usually
> correct.
> 
> Discussed in:
> '[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that without a
> process to debug"'
> 
> Suggested-by: Fam Zheng <famz@redhat.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-Id: <20171215181810.4122-1-marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks, I can add it to my 2 patches series for dump (to avoid error on Peter's end)

Unless you send a pull request with it sonnish


> ---
>  scripts/checkpatch.pl | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 34df753571..3dc27d9656 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2475,8 +2475,11 @@ sub process {
>  
>  # no volatiles please
>  		my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
> -		if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
> -			ERROR("Use of volatile is usually wrong: see
> Documentation/volatile-considered-harmful.txt\n" . $herecurr);
> +		if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/ &&
> +                    $line !~ /sig_atomic_t/ &&
> +                    !ctx_has_comment($first_line, $linenr)) {
> +			my $msg = "Use of volatile is usually wrong, please add a comment\n" .
> $herecurr;
> +                        ERROR($msg);
>  		}
>  
>  # warn about #if 0
> --
> 2.14.3
> 
> 

  reply	other threads:[~2017-12-18 13:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 13:03 [Qemu-devel] [PATCH v2] checkpatch: volatile with a comment or sig_atomic_t is okay Paolo Bonzini
2017-12-18 13:07 ` Marc-André Lureau [this message]
2017-12-18 13:08   ` Paolo Bonzini
2017-12-18 13:23 ` no-reply

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=167321084.622468.1513602441314.JavaMail.zimbra@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=famz@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.