All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.com>,
	Douglas Gilbert <dgilbert@interlog.com>,
	Colin Ian King <colin.king@canonical.com>
Subject: Re: [PATCH] scsi/trace: Use get_unaligned_be*()
Date: Thu, 31 Oct 2019 22:31:36 -0400	[thread overview]
Message-ID: <yq15zk45nuf.fsf@oracle.com> (raw)
In-Reply-To: <20191031174217.124406-1-bvanassche@acm.org> (Bart Van Assche's message of "Thu, 31 Oct 2019 10:42:17 -0700")


Bart,

> This patch fixes an unintended sign extension on left shifts. From
> Colin King: "Shifting a u8 left will cause the value to be promoted to
> an integer. If the top bit of the u8 is set then the following
> conversion to an u64 will sign extend the value causing the upper 32
> bits to be set in the result."

Looks good in general. One minor nit:

> +	 * From SBC-2: a TRANSFER LENGTH field set to zero specifies that 256
> +	 * logical blocks shall be read (READ(6)) or written (WRITE(6)).
> +	 */
> +	txlen = cdb[4] ? : 256;

Please avoid using the gcc conditional extension. Please either write it
out in full or make it an if statement.

Also, maybe this change should be a separate patch.

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2019-11-01  2:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31 17:42 [PATCH] scsi/trace: Use get_unaligned_be*() Bart Van Assche
2019-11-01  2:31 ` Martin K. Petersen [this message]
2019-11-01 21:14 Bart Van Assche
2019-11-02  0:29 ` 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=yq15zk45nuf.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=bvanassche@acm.org \
    --cc=colin.king@canonical.com \
    --cc=dgilbert@interlog.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.