From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, jsnow@redhat.com,
Anton Nefedov <anton.nefedov@virtuozzo.com>
Subject: [Qemu-devel] [PULL 2/4] ide: move ide_sect_range_ok() up
Date: Fri, 19 Jan 2018 17:31:57 -0500 [thread overview]
Message-ID: <20180119223159.29890-3-jsnow@redhat.com> (raw)
In-Reply-To: <20180119223159.29890-1-jsnow@redhat.com>
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
to use it without a forward declaration in the commit to follow
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Message-id: 1512735034-35327-3-git-send-email-anton.nefedov@virtuozzo.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
hw/ide/core.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 875f7b442d..27226bfd51 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -380,6 +380,18 @@ static void ide_set_signature(IDEState *s)
}
}
+static bool ide_sect_range_ok(IDEState *s,
+ uint64_t sector, uint64_t nb_sectors)
+{
+ uint64_t total_sectors;
+
+ blk_get_geometry(s->blk, &total_sectors);
+ if (sector > total_sectors || nb_sectors > total_sectors - sector) {
+ return false;
+ }
+ return true;
+}
+
typedef struct TrimAIOCB {
BlockAIOCB common;
IDEState *s;
@@ -603,18 +615,6 @@ static void ide_rw_error(IDEState *s) {
ide_set_irq(s->bus);
}
-static bool ide_sect_range_ok(IDEState *s,
- uint64_t sector, uint64_t nb_sectors)
-{
- uint64_t total_sectors;
-
- blk_get_geometry(s->blk, &total_sectors);
- if (sector > total_sectors || nb_sectors > total_sectors - sector) {
- return false;
- }
- return true;
-}
-
static void ide_buffered_readv_cb(void *opaque, int ret)
{
IDEBufferedRequest *req = opaque;
--
2.14.3
next prev parent reply other threads:[~2018-01-19 22:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 22:31 [Qemu-devel] [PULL 0/4] Ide patches John Snow
2018-01-19 22:31 ` [Qemu-devel] [PULL 1/4] ide: pass IDEState to trim AIO callback John Snow
2018-01-19 22:31 ` John Snow [this message]
2018-01-19 22:31 ` [Qemu-devel] [PULL 3/4] ide: abort TRIM operation for invalid range John Snow
2018-01-19 22:31 ` [Qemu-devel] [PULL 4/4] hw/ide: Remove duplicated definitions from ahci_internal.h John Snow
2018-01-22 11:37 ` [Qemu-devel] [PULL 0/4] Ide patches Peter Maydell
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=20180119223159.29890-3-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=anton.nefedov@virtuozzo.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).