public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Colin King <colin.king@canonical.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>,
	Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>,
	Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>,
	linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: fix unintended sign extension on left shifts
Date: Mon, 14 Oct 2019 08:58:03 -0700	[thread overview]
Message-ID: <0e2a6d4c-b346-cb1b-7941-e247a0d0f8b2@acm.org> (raw)
In-Reply-To: <20191014121613.21999-1-colin.king@canonical.com>

On 10/14/19 5:16 AM, Colin King wrote:
> diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c
> index 0f17e7dac1b0..1d3a5a2dc229 100644
> --- a/drivers/scsi/scsi_trace.c
> +++ b/drivers/scsi/scsi_trace.c
> @@ -38,7 +38,7 @@ scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len)
>   	const char *ret = trace_seq_buffer_ptr(p);
>   	sector_t lba = 0, txlen = 0;
>   
> -	lba |= (cdb[2] << 24);
> +	lba |= ((u64)cdb[2] << 24);
>   	lba |= (cdb[3] << 16);
>   	lba |= (cdb[4] << 8);
>   	lba |=  cdb[5];

Have you considered to use get/put_unaligned_be*() instead of making the 
above change?

Thanks,

Bart.

  reply	other threads:[~2019-10-14 15:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 12:16 [PATCH] scsi: fix unintended sign extension on left shifts Colin King
2019-10-14 15:58 ` Bart Van Assche [this message]
2019-10-15  7:44   ` Christoph Hellwig

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=0e2a6d4c-b346-cb1b-7941-e247a0d0f8b2@acm.org \
    --to=bvanassche@acm.org \
    --cc=colin.king@canonical.com \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kusumi.tomohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tokunaga.keiich@jp.fujitsu.com \
    --cc=xiaoguangrong@cn.fujitsu.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