Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752692AbdDDHJM (ORCPT ); Tue, 4 Apr 2017 03:09:12 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:52535 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbdDDHJK (ORCPT ); Tue, 4 Apr 2017 03:09:10 -0400 Date: Tue, 4 Apr 2017 00:09:09 -0700 From: Christoph Hellwig To: Dmitry Monakhov Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, martin.petersen@oracle.com Subject: Re: [PATCH 6/7] T10: Move opencoded contants to common header Message-ID: <20170404070909.GG12008@infradead.org> References: <1491204212-9952-1-git-send-email-dmonakhov@openvz.org> <1491204212-9952-7-git-send-email-dmonakhov@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1491204212-9952-7-git-send-email-dmonakhov@openvz.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 810 Lines: 25 > - if ((src->ref_tag == 0xffffffff) || > - (src->app_tag == 0xffff)) { > + if ((src->ref_tag == T10_REF_ESCAPE) || > + (src->app_tag == T10_APP_ESCAPE)) { Please remove the inner braces while you're at it (also later in the patch). > index 9fba9dd..c96845c 100644 > --- a/include/linux/t10-pi.h > +++ b/include/linux/t10-pi.h > @@ -24,6 +24,9 @@ enum t10_dif_type { > T10_PI_TYPE3_PROTECTION = 0x3, > }; > > +static const __be16 T10_APP_ESCAPE = (__force __be16) 0xffff; > +static const __be32 T10_REF_ESCAPE = (__force __be32) 0xffffffff; I'd do this as: #define T10_APP_ESCAPE cpu_to_be16(0xffff); #define T10_REF_ESCAPE cpu_to_be32(0xffffffff); This avoids relying on the compiler to merge constants, and also gets the endianess annotation right instead of force escaping it.