From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86: fix cache flushing condition in map_pages_to_xen() Date: Thu, 18 Jul 2013 08:37:59 +0100 Message-ID: References: <51E79013020000780009E906@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Uzin1-0002oc-HA for xen-devel@lists.xenproject.org; Thu, 18 Jul 2013 07:38:15 +0000 Received: by mail-wi0-f169.google.com with SMTP id c10so513292wiw.2 for ; Thu, 18 Jul 2013 00:38:12 -0700 (PDT) In-Reply-To: <51E79013020000780009E906@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Andrew Cooper Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 18/07/2013 06:49, "Jan Beulich" wrote: >>> Ugly. I actually picked the same name intentionally. >> >> I'm not too strongly opinionated on this one, but it did make me look twice. >> I think it would be cleaner something like: >> #define flush_flags(oldf) ({ unsigned int f_ = 0; ...; _f; }) >> ... >> flush_flags |= flush_flags(...); >> The 'name collision' I'm fine with, whereas going directly at a caller's >> variable within a macro is rather grubby behaviour. ;) > > But that would still leave the macro access "flags" directly. Hmmm true. Don't really want to expand the verbiage at each macro call site any further, so I guess your existing approach is also my preferred one. > And while I > realize > that this is (slightly) odd behavior for a macro, that's precisely the reason > why > I #undef it right after the function. Perhaps this could be made even more > clear > by moving #define and #undef inside the function... Yes, that might be slightly preferable. -- Keir