From: yuchenlin <yuchenlin@synology.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/2] Refine some vdi code
Date: Mon, 30 Jul 2018 15:49:52 +0800 [thread overview]
Message-ID: <6616ccd2-847b-4f5b-bdcd-e0c4d6a2263a@Mail> (raw)
In-Reply-To: <96bc216a-d335-dd36-06f0-5985bb52df53@weilnetz.de>
Hi, Stefan
I agree that redundancy of If else may helps people to understand the code.
However, CONFIG_VDI_WRITE only contributes:
#if defined(CONFIG_VDI_WRITE)
.bdrv_co_pwritev = vdi_co_pwritev,
#endif
I think we don't need CONFIG_VDI_WRITE to document the code.
As its name implies, vdi_co_pwritev shows the code parts for vdi write support.
I appreciated your time and effort for reviews.
Regards,
yuchenlin
Stefan Weil <sw@weilnetz.de> 於 2018-07-30 15:13 寫道:
> Am 30.07.2018 um 04:46 schrieb yuchenlin@synology.com: > From: yuchenlin <yuchenlin@synology.com> > > This series refine some code in vdi.c, includes: > > * Remvoe CONFIG_VDI_WRITE because there is no reason to leave an always on > and cannot configure option in the code-side. > * decouple if else if chain to get more readability. > > Thanks, > yuchenlin > > yuchenlin (2): > vdi: remove CONFIG_VDI_WRITE > vdi: refine code for vdi_open > > block/vdi.c | 32 ++++++++++++++++++-------------- > 1 file changed, 18 insertions(+), 14 deletions(-) Technically these changes are fine, but personally I prefer my old code. If else is rendundant here, but redundancy helps humans to understand the code. CONFIG_VDI_WRITE still has a similar function as it documents which code parts are relevant for write support. Stefan
prev parent reply other threads:[~2018-07-30 7:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 2:46 [Qemu-devel] [PATCH 0/2] Refine some vdi code yuchenlin
2018-07-30 2:47 ` [Qemu-devel] [PATCH 1/2] vdi: remove CONFIG_VDI_WRITE yuchenlin
2018-07-30 2:47 ` [Qemu-devel] [PATCH 2/2] vdi: refine code for vdi_open yuchenlin
2018-07-30 7:12 ` [Qemu-devel] [PATCH 0/2] Refine some vdi code Stefan Weil
2018-07-30 7:49 ` yuchenlin [this message]
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=6616ccd2-847b-4f5b-bdcd-e0c4d6a2263a@Mail \
--to=yuchenlin@synology.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).