From: "Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>
To: "martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"srv_heupstream@mediatek.com" <srv_heupstream@mediatek.com>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH] scsi: fix the return value of scsi_logical_block_count
Date: Tue, 13 Aug 2024 03:35:47 +0000 [thread overview]
Message-ID: <f1a25a35d10540461522219681bcc1e897f643b2.camel@mediatek.com> (raw)
In-Reply-To: <yq1ttfpw5zs.fsf@ca-mkp.ca.oracle.com>
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
next prev parent reply other threads:[~2024-08-13 3:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 0:57 [PATCH] scsi: fix the return value of scsi_logical_block_count Chaotian Jing
2024-08-13 1:52 ` Martin K. Petersen
2024-08-13 3:35 ` Chaotian Jing (井朝天) [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-06 7:26 Chaotian Jing
2024-08-06 20:51 ` Bart Van Assche
2024-08-07 8:47 ` John Garry
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=f1a25a35d10540461522219681bcc1e897f643b2.camel@mediatek.com \
--to=chaotian.jing@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bvanassche@acm.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=srv_heupstream@mediatek.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox