mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "joe@perches.com" <joe@perches.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"willy@linux.intel.com" <willy@linux.intel.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 01/11] block: nvme-scsi: Fix probable mask then right shift defects
Date: Mon, 10 Nov 2014 19:33:54 +0000	[thread overview]
Message-ID: <1415648084.4373.2.camel@omniknight.lm.intel.com> (raw)
In-Reply-To: <8cd08200f7cc1d1a7562d61f22a0758ec7ca182a.1414387334.git.joe@perches.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2410 bytes --]

On Sun, 2014-10-26 at 22:24 -0700, Joe Perches wrote:
> Precedence of & and >> is not the same and is not left to right.
> shift has higher precedence and should be done after the mask.
> 
> Add parentheses around the mask.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Vishal Verma <vishal.l.verma@linux.intel.com>

> ---
>  drivers/block/nvme-scsi.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/block/nvme-scsi.c b/drivers/block/nvme-scsi.c
> index a4cd6d6..529ee54 100644
> --- a/drivers/block/nvme-scsi.c
> +++ b/drivers/block/nvme-scsi.c
> @@ -1972,8 +1972,8 @@ static inline void nvme_trans_get_io_cdb10(u8 *cmd,
>  {
>  	cdb_info->fua = GET_U8_FROM_CDB(cmd, IO_10_CDB_FUA_OFFSET) &
>  					IO_CDB_FUA_MASK;
> -	cdb_info->prot_info = GET_U8_FROM_CDB(cmd, IO_10_CDB_WP_OFFSET) &
> -					IO_CDB_WP_MASK >> IO_CDB_WP_SHIFT;
> +	cdb_info->prot_info = (GET_U8_FROM_CDB(cmd, IO_10_CDB_WP_OFFSET) &
> +			       IO_CDB_WP_MASK) >> IO_CDB_WP_SHIFT;
>  	cdb_info->lba = GET_U32_FROM_CDB(cmd, IO_10_CDB_LBA_OFFSET);
>  	cdb_info->xfer_len = GET_U16_FROM_CDB(cmd, IO_10_CDB_TX_LEN_OFFSET);
>  }
> @@ -1983,8 +1983,8 @@ static inline void nvme_trans_get_io_cdb12(u8 *cmd,
>  {
>  	cdb_info->fua = GET_U8_FROM_CDB(cmd, IO_12_CDB_FUA_OFFSET) &
>  					IO_CDB_FUA_MASK;
> -	cdb_info->prot_info = GET_U8_FROM_CDB(cmd, IO_12_CDB_WP_OFFSET) &
> -					IO_CDB_WP_MASK >> IO_CDB_WP_SHIFT;
> +	cdb_info->prot_info = (GET_U8_FROM_CDB(cmd, IO_12_CDB_WP_OFFSET) &
> +			       IO_CDB_WP_MASK) >> IO_CDB_WP_SHIFT;
>  	cdb_info->lba = GET_U32_FROM_CDB(cmd, IO_12_CDB_LBA_OFFSET);
>  	cdb_info->xfer_len = GET_U32_FROM_CDB(cmd, IO_12_CDB_TX_LEN_OFFSET);
>  }
> @@ -1994,8 +1994,8 @@ static inline void nvme_trans_get_io_cdb16(u8 *cmd,
>  {
>  	cdb_info->fua = GET_U8_FROM_CDB(cmd, IO_16_CDB_FUA_OFFSET) &
>  					IO_CDB_FUA_MASK;
> -	cdb_info->prot_info = GET_U8_FROM_CDB(cmd, IO_16_CDB_WP_OFFSET) &
> -					IO_CDB_WP_MASK >> IO_CDB_WP_SHIFT;
> +	cdb_info->prot_info = (GET_U8_FROM_CDB(cmd, IO_16_CDB_WP_OFFSET) &
> +			       IO_CDB_WP_MASK) >> IO_CDB_WP_SHIFT;
>  	cdb_info->lba = GET_U64_FROM_CDB(cmd, IO_16_CDB_LBA_OFFSET);
>  	cdb_info->xfer_len = GET_U32_FROM_CDB(cmd, IO_16_CDB_TX_LEN_OFFSET);
>  }

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2014-11-10 19:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27  5:24 [PATCH 00/11] treewide: mask then shift defects and style updates Joe Perches
2014-10-27  5:24 ` [PATCH 01/11] block: nvme-scsi: Fix probable mask then right shift defects Joe Perches
2014-11-10 19:33   ` Verma, Vishal L [this message]
2014-10-27  5:24 ` [PATCH 02/11] radeon: evergreen: " Joe Perches
2014-10-27  9:14   ` Michel Dänzer
2014-10-27 14:14     ` [PATCH 02/11 V2] radeon: evergreen: Fix probable mask then right shift defect Joe Perches
2014-10-28  3:42       ` Michel Dänzer
2014-10-28 14:06       ` Alex Deucher
2014-10-29  3:03         ` Michel Dänzer
2014-10-27  5:24 ` [PATCH 03/11] aiptek: Fix probable mask then right shift defects Joe Perches
2014-10-27 14:44   ` Dmitry Torokhov
2014-10-27 17:56     ` Joe Perches
2014-10-27 18:01       ` Dmitry Torokhov
2014-10-27 18:03         ` Joe Perches
2014-10-27  5:25 ` [PATCH 04/11] dvb-net: " Joe Perches
2014-10-27  5:25 ` [PATCH 05/11] cx25840/cx18: Use standard ordering of mask and shift Joe Perches
2014-11-08 13:41   ` Andy Walls
2014-10-27  5:25 ` [PATCH 06/11] wm8350-core: Fix probable mask then right shift defect Joe Perches
2014-10-27 12:47   ` Charles Keepax
2014-11-03 18:02   ` Lee Jones
2014-10-27  5:25 ` [PATCH 07/11] iwlwifi: dvm: " Joe Perches
2014-10-27  6:14   ` Grumbach, Emmanuel
2014-10-27  5:25 ` [PATCH 08/11] ssb: driver_chip_comon_pmu: " Joe Perches
2014-10-27 17:32   ` Michael Büsch
2014-10-27  5:25 ` [PATCH 09/11] tty: ipwireless: Fix probable mask then right shift defects Joe Perches
2014-10-27 13:18   ` David Sterba
2014-10-27 14:17   ` Jiri Kosina
2014-10-28  1:57     ` Greg Kroah-Hartman
2014-10-27  5:25 ` [PATCH 10/11] hwa-hc: Fix probable mask then right shift defect Joe Perches
2014-10-27  5:25 ` [PATCH 11/11] sound: ad1889: Fix probable mask then right shift defects Joe Perches
2014-10-27  7:41   ` Takashi Iwai

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=1415648084.4373.2.camel@omniknight.lm.intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=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

Powered by JetHome