[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f1a25a35d10540461522219681bcc1e897f643b2.camel@mediatek.com>
Date: Tue, 13 Aug 2024 03:35:47 +0000
From: Chaotian Jing (井朝天)
<Chaotian.Jing@...iatek.com>
To: "martin.petersen@...cle.com" <martin.petersen@...cle.com>
CC: "linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>, "bvanassche@....org"
<bvanassche@....org>, "linux-scsi@...r.kernel.org"
<linux-scsi@...r.kernel.org>, "srv_heupstream@...iatek.com"
<srv_heupstream@...iatek.com>, "James.Bottomley@...senPartnership.com"
<James.Bottomley@...senPartnership.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
<matthias.bgg@...il.com>, "angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH] scsi: fix the return value of scsi_logical_block_count
On Mon, 2024-08-12 at 21:52 -0400, Martin K. Petersen wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
> Chaotian,
>
> > @@ -236,7 +236,7 @@ static inline unsigned int
> scsi_logical_block_count(struct scsi_cmnd *scmd)
> > {
> > unsigned int shift = ilog2(scmd->device->sector_size) -
> SECTOR_SHIFT;
> >
> > - return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift;
> > + return blk_rq_sectors(scsi_cmd_to_rq(scmd)) >> shift;
> > }
>
> There's no point in shifting twice by converting to sectors first.
> Please just remove the SECTOR_SHIFT subtraction.
>
Thanks, will fix it at next version.
> --
> Martin K. Petersen Oracle Linux Engineering
Powered by blists - more mailing lists