From: "Jan Beulich" Subject: Re: [PATCH 1/4] hvmloader: Fixup pci_write* macros Date: Tue, 16 Jun 2015 08:39:34 +0100 Message-ID: <557FEED60200007800085410@mail.emea.novell.com> References: <1434377752-15705-1-git-send-email-dslutz@verizon.com> <1434377752-15705-2-git-send-email-dslutz@verizon.com> <557EDEE0.9060901@citrix.com> <557EE198.1080303@one.verizon.com> <557EE2C7.6060801@citrix.com> <557F0A010200007800085012@mail.emea.novell.com> <20150615190939.6238e731@mdontu-l.dsd.bitdefender.biz> <557F080C.5040606@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <557F080C.5040606@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Ian Jackson , Don Slutz , Don Slutz , xen-devel@lists.xen.org, Keir Fraser , mihai.dontu@gmail.com List-Id: xen-devel@lists.xenproject.org >>> On 15.06.15 at 19:14, wrote: > Personally, I would go a step further and suggest that if a macro is not > doing {string,token}isation, or deliberately playing with local state, > it should be a static inline function instead (although I do appear to > be in the minority with this view). > > This way, the compiler is able to provide far more coherent error > messages and spot type errors, both of which reduce the number of errors > which can accidentally be introduced. Furthermore, the compiler is also > able to ignore the 'inline' if it decides it knows better, which > generally results in more efficient code. I certainly agree, but due to dependencies between headers this isn't always possible. Plus, in cases where things just get forwarded to a function type checking will still take place as desired. I.e. again simple things like #define macro(x, y) function(x, y, 0) don't have a need to become inline functions. More involved things would preferably indeed get converted. Jan