linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dmitry Monakhov <dmonakhov@openvz.org>
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
Date: Tue, 4 Apr 2017 00:09:09 -0700	[thread overview]
Message-ID: <20170404070909.GG12008@infradead.org> (raw)
In-Reply-To: <1491204212-9952-7-git-send-email-dmonakhov@openvz.org>

> -				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.

  reply	other threads:[~2017-04-04  7:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  7:23 [PATCH 0/7] block: T10/DIF Fixes and cleanups v2 Dmitry Monakhov
2017-04-03  7:23 ` [PATCH 1/7] bio-integrity: Do not allocate integrity context for bio w/o data Dmitry Monakhov
2017-04-04  7:00   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 2/7] bio-integrity: save original iterator for verify stage Dmitry Monakhov
2017-04-04  7:01   ` Christoph Hellwig
2017-04-04 12:15     ` Dmitry Monakhov
2017-04-03  7:23 ` [PATCH 3/7] bio-integrity: bio_trim should truncate integrity vector accordingly Dmitry Monakhov
2017-04-04  7:01   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 4/7] bio-integrity: fix interface for bio_integrity_trim Dmitry Monakhov
2017-04-04  7:03   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 5/7] bio-integrity: add bio_integrity_setup helper Dmitry Monakhov
2017-04-04  7:06   ` Christoph Hellwig
2017-04-03  7:23 ` [PATCH 6/7] T10: Move opencoded contants to common header Dmitry Monakhov
2017-04-04  7:09   ` Christoph Hellwig [this message]
2017-04-03  7:23 ` [PATCH 7/7] Guard bvec iteration logic v2 Dmitry Monakhov
2017-04-03 14:34   ` Jens Axboe
2017-04-04 15:03   ` Ming Lei
2017-04-04 15:19     ` Dmitry Monakhov
2017-04-04 15:56       ` Ming Lei
2017-04-03 21:12 ` [PATCH 0/7] block: T10/DIF Fixes and cleanups v2 Martin K. Petersen

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=20170404070909.GG12008@infradead.org \
    --to=hch@infradead.org \
    --cc=dmonakhov@openvz.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).