All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: jerin.jacob@caviumnetworks.com, jia.he@hxt-semitech.com
Subject: Re: [PATCH] eal/arm64: fix memory barrier macros
Date: Tue, 16 Jan 2018 01:21:28 +0100	[thread overview]
Message-ID: <5787318.2SUBePpODR@xps> (raw)
In-Reply-To: <20180115235934.16054-1-thomas@monjalon.net>

16/01/2018 00:59, Thomas Monjalon:
> The macros dsb and dmb are defined as an instruction block with braces.
> As a consequence, when it is used in if/else without brace:
> 	if (cond)
> 		rte_mb();
> 	else
> 		statement;
> the added semicolon is parsed outside of if/else,
> so the "else" cannot match the "if":
> 	if (cond) {
> 		asm volatile("dsb sy" : : : "memory");
> 	}
> 	;
> 	else
> 		statement
> 
> The solution is either to use the "do { } while (0)" construct,
> or simply remove the braces because there is only one statement.
> 
> Fixes: 84733fd0d75e ("eal/arm64: fix memory barrier definition")

Just seen there is already a patch doing the same thing by Jia He:
	https://dpdk.org/patch/31896
This patch is in a series waiting for required changes.

      reply	other threads:[~2018-01-16  0:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 23:59 [PATCH] eal/arm64: fix memory barrier macros Thomas Monjalon
2018-01-16  0:21 ` Thomas Monjalon [this message]

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=5787318.2SUBePpODR@xps \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=jia.he@hxt-semitech.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 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.