From patchwork Fri Jul 15 16:12:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 9232283 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 1647B6075D for ; Fri, 15 Jul 2016 16:18:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0785127F94 for ; Fri, 15 Jul 2016 16:18:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F07DF27FA4; Fri, 15 Jul 2016 16:18:51 +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 84CC327F94 for ; Fri, 15 Jul 2016 16:18:51 +0000 (UTC) Received: from localhost ([::1]:33643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO5pC-00064t-21 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jul 2016 12:18:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO5io-0006wG-Ul for qemu-devel@nongnu.org; Fri, 15 Jul 2016 12:12:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO5in-0000CN-1U for qemu-devel@nongnu.org; Fri, 15 Jul 2016 12:12:13 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:38172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO5im-0000Bv-LW for qemu-devel@nongnu.org; Fri, 15 Jul 2016 12:12:12 -0400 Received: from gw-2.ac.upc.es (gw-2.ac.upc.es [147.83.30.8]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id u6FGCBBB018197; Fri, 15 Jul 2016 18:12:11 +0200 Received: from localhost (unknown [84.88.51.85]) by gw-2.ac.upc.es (Postfix) with ESMTPSA id 5F2018CA; Fri, 15 Jul 2016 18:12:11 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Fri, 15 Jul 2016 18:12:11 +0200 Message-Id: <146859913112.13167.2665022603013407931.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 2.8.1 In-Reply-To: <146859912008.13167.16620247780754204168.stgit@fimbulvetr.bsc.es> References: <146859912008.13167.16620247780754204168.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id u6FGCBBB018197 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH 2/4] queue: Add macro for incremental traversal 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: Paolo Bonzini , Peter Crosthwaite , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Adds macro QTAILQ_FOREACH_CONTINUE to support incremental list traversal. Signed-off-by: LluĂ­s Vilanova --- include/qemu/queue.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/qemu/queue.h b/include/qemu/queue.h index f781aa2..c19f7ee 100644 --- a/include/qemu/queue.h +++ b/include/qemu/queue.h @@ -414,6 +414,11 @@ struct { \ (var); \ (var) = ((var)->field.tqe_next)) +#define QTAILQ_FOREACH_CONTINUE(var, field) \ + for ((var) = ((var)->field.tqe_next); \ + (var); \ + (var) = ((var)->field.tqe_next)) + #define QTAILQ_FOREACH_SAFE(var, head, field, next_var) \ for ((var) = ((head)->tqh_first); \ (var) && ((next_var) = ((var)->field.tqe_next), 1); \