From: Greg Kurz <groug@kaod.org>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] 9pfs: simplify blksize_to_iounit()
Date: Mon, 27 Sep 2021 18:28:31 +0200 [thread overview]
Message-ID: <20210927182831.2cee0cf8@bahia.huguette> (raw)
In-Reply-To: <b84eb324d2ebdcc6f9c442c97b5b4d01eecb4f43.1632758315.git.qemu_oss@crudebyte.com>
On Mon, 27 Sep 2021 17:50:36 +0200
Christian Schoenebeck <qemu_oss@crudebyte.com> wrote:
> Use QEMU_ALIGN_DOWN() macro to reduce code and to make it
> more human readable.
>
> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/9pfs/9p.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index c65584173a..29cc19c90a 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -1280,8 +1280,7 @@ static int32_t blksize_to_iounit(const V9fsPDU *pdu, int32_t blksize)
> * as well as less than (client msize - P9_IOHDRSZ)
> */
> if (blksize) {
> - iounit = blksize;
> - iounit *= (s->msize - P9_IOHDRSZ) / blksize;
> + iounit = QEMU_ALIGN_DOWN(s->msize - P9_IOHDRSZ, blksize);
> }
> if (!iounit) {
> iounit = s->msize - P9_IOHDRSZ;
next prev parent reply other threads:[~2021-09-27 16:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 15:44 [PATCH 0/2] 9pfs: iounit cleanup Christian Schoenebeck
2021-09-27 15:45 ` [PATCH 1/2] 9pfs: deduplicate iounit code Christian Schoenebeck
2021-09-27 16:27 ` Greg Kurz
2021-09-27 16:50 ` Christian Schoenebeck
2021-09-27 17:30 ` Greg Kurz
2021-09-27 15:50 ` [PATCH 2/2] 9pfs: simplify blksize_to_iounit() Christian Schoenebeck
2021-09-27 16:28 ` Greg Kurz [this message]
2021-09-27 17:53 ` Philippe Mathieu-Daudé
2021-09-28 11:53 ` [PATCH 0/2] 9pfs: iounit cleanup Christian Schoenebeck
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=20210927182831.2cee0cf8@bahia.huguette \
--to=groug@kaod.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.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;
as well as URLs for NNTP newsgroup(s).