From patchwork Fri Jan 19 22:31:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 10176045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0866F6055D for ; Fri, 19 Jan 2018 22:39:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF2462876A for ; Fri, 19 Jan 2018 22:39:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3F2D28774; Fri, 19 Jan 2018 22:39:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 756F22876A for ; Fri, 19 Jan 2018 22:39:04 +0000 (UTC) Received: from localhost ([::1]:50138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecfJP-0004T7-KQ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Jan 2018 17:39:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecfCf-0007jy-ST for qemu-devel@nongnu.org; Fri, 19 Jan 2018 17:32:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecfCe-0005Kt-N1 for qemu-devel@nongnu.org; Fri, 19 Jan 2018 17:32:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecfCe-0005I3-HW for qemu-devel@nongnu.org; Fri, 19 Jan 2018 17:32:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADD981A4085; Fri, 19 Jan 2018 22:32:03 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-231.bos.redhat.com [10.18.17.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 291BA81213; Fri, 19 Jan 2018 22:32:03 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Fri, 19 Jan 2018 17:31:57 -0500 Message-Id: <20180119223159.29890-3-jsnow@redhat.com> In-Reply-To: <20180119223159.29890-1-jsnow@redhat.com> References: <20180119223159.29890-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 19 Jan 2018 22:32:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/4] ide: move ide_sect_range_ok() up X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Anton Nefedov , jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Anton Nefedov to use it without a forward declaration in the commit to follow Signed-off-by: Anton Nefedov Message-id: 1512735034-35327-3-git-send-email-anton.nefedov@virtuozzo.com Signed-off-by: John Snow --- 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;