linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: willy@linux.intel.com (Matthew Wilcox)
Subject: [PATCH] Add data transfer length check for admin commands
Date: Tue, 3 Sep 2013 13:05:08 -0400	[thread overview]
Message-ID: <20130903170508.GZ4707@linux.intel.com> (raw)
In-Reply-To: <1378141276-4356-1-git-send-email-prasadjoshi.linux@gmail.com>

On Mon, Sep 02, 2013@10:31:16PM +0530, Prasad Joshi wrote:
> diff --git a/include/linux/nvme.h b/include/linux/nvme.h

I think you generated this patch against Linus' tree rather than the NVMe
tree (http://git.infradead.org/users/willy/linux-nvme.git).  The __KERNEL__
ifdefs are gone due to the separation of this file into the uapi and non-uapi
versions.

> +/*
> + * The 2 LSB bits of NVME Admin command opcode are called as data transfer bits.
> + * These two bits define where a command should include data transfer
> + * information.
> + */
> +#define NVME_ADMIN_CMD_DATA_XFER_MASK (0b11)
> +

Binary constants are a GCC extension, which I would prefer to avoid.
They're only available from gcc 4.3 onwards, and apparently we still
support gcc versions as old as 3.2.

The bits aren't just for admin commands (so we should correct both the
comment and the name of the constant).  How about adding:

	NVME_DATA_XFER_NONE	= 0,
	NVME_DATA_XFER_READ	= 1,
	NVME_DATA_XFER_WRITE	= 2,
	NVME_DATA_XFER_BIDI	= 3,
	NVME_DATA_XFER_MASK	= 3,

to the 'enum nvme_opcode' definition?

  reply	other threads:[~2013-09-03 17:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02 17:01 [PATCH] Add data transfer length check for admin commands Prasad Joshi
2013-09-03 17:05 ` Matthew Wilcox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-09-02 17:00 Prasad Joshi
2013-09-02 16:59 Prasad Joshi

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=20130903170508.GZ4707@linux.intel.com \
    --to=willy@linux.intel.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).