From patchwork Thu Mar 3 12:37:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 8492371 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8DECC0553 for ; Thu, 3 Mar 2016 12:38:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AA0D20295 for ; Thu, 3 Mar 2016 12:38:03 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 5859120270 for ; Thu, 3 Mar 2016 12:38:02 +0000 (UTC) Received: from localhost ([::1]:34642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abSW1-0005xB-On for patchwork-qemu-devel@patchwork.kernel.org; Thu, 03 Mar 2016 07:38:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abSVf-0005sQ-VZ for qemu-devel@nongnu.org; Thu, 03 Mar 2016 07:37:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abSVY-0004Pu-ME for qemu-devel@nongnu.org; Thu, 03 Mar 2016 07:37:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abSVY-0004Ph-Eo for qemu-devel@nongnu.org; Thu, 03 Mar 2016 07:37:32 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1D02ED2ED2; Thu, 3 Mar 2016 12:37:32 +0000 (UTC) Received: from localhost (ovpn-113-82.phx2.redhat.com [10.3.113.82]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u23CbUca006412; Thu, 3 Mar 2016 07:37:31 -0500 From: Amit Shah To: Peter Maydell Date: Thu, 3 Mar 2016 18:07:07 +0530 Message-Id: <3c52ddcdc548e7fbe65112d8a7bdc9cd105b4750.1457008497.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 03 Mar 2016 12:37:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: Amit Shah , thuth@redhat.com, lprosek@redhat.com, qemu list Subject: [Qemu-devel] [PULL 2/6] rng: remove the unused request cancellation code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ladi Prosek rng_backend_cancel_requests had no callers and none of the code deleted in this commit ever ran. Signed-off-by: Ladi Prosek Reviewed-by: Amit Shah Message-Id: <1456994238-9585-2-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah --- backends/rng-egd.c | 12 ------------ backends/rng.c | 9 --------- include/sysemu/rng.h | 11 ----------- 3 files changed, 32 deletions(-) diff --git a/backends/rng-egd.c b/backends/rng-egd.c index 2de5cd5..0b2976a 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -125,17 +125,6 @@ static void rng_egd_free_requests(RngEgd *s) s->requests = NULL; } -static void rng_egd_cancel_requests(RngBackend *b) -{ - RngEgd *s = RNG_EGD(b); - - /* We simply delete the list of pending requests. If there is data in the - * queue waiting to be read, this is okay, because there will always be - * more data than we requested originally - */ - rng_egd_free_requests(s); -} - static void rng_egd_opened(RngBackend *b, Error **errp) { RngEgd *s = RNG_EGD(b); @@ -213,7 +202,6 @@ static void rng_egd_class_init(ObjectClass *klass, void *data) RngBackendClass *rbc = RNG_BACKEND_CLASS(klass); rbc->request_entropy = rng_egd_request_entropy; - rbc->cancel_requests = rng_egd_cancel_requests; rbc->opened = rng_egd_opened; } diff --git a/backends/rng.c b/backends/rng.c index b7820ef..2f2f3ee 100644 --- a/backends/rng.c +++ b/backends/rng.c @@ -26,15 +26,6 @@ void rng_backend_request_entropy(RngBackend *s, size_t size, } } -void rng_backend_cancel_requests(RngBackend *s) -{ - RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); - - if (k->cancel_requests) { - k->cancel_requests(s); - } -} - static bool rng_backend_prop_get_opened(Object *obj, Error **errp) { RngBackend *s = RNG_BACKEND(obj); diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index 858be8c..87b3ebe 100644 --- a/include/sysemu/rng.h +++ b/include/sysemu/rng.h @@ -37,7 +37,6 @@ struct RngBackendClass void (*request_entropy)(RngBackend *s, size_t size, EntropyReceiveFunc *receive_entropy, void *opaque); - void (*cancel_requests)(RngBackend *s); void (*opened)(RngBackend *s, Error **errp); }; @@ -68,14 +67,4 @@ struct RngBackend void rng_backend_request_entropy(RngBackend *s, size_t size, EntropyReceiveFunc *receive_entropy, void *opaque); - -/** - * rng_backend_cancel_requests: - * @s: the backend to cancel all pending requests in - * - * Cancels all pending requests submitted by @rng_backend_request_entropy. This - * should be used by a device during reset or in preparation for live migration - * to stop tracking any request. - */ -void rng_backend_cancel_requests(RngBackend *s); #endif