From patchwork Tue Jan 22 01:14:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1028992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43k9WK5T8Sz9s4s for ; Tue, 22 Jan 2019 12:17:17 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 73C9E4185; Tue, 22 Jan 2019 01:17:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CFA9941E4 for ; Tue, 22 Jan 2019 01:14:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2C7B76CE for ; Tue, 22 Jan 2019 01:14:43 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigill.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 1024020004; Tue, 22 Jan 2019 01:14:40 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Mon, 21 Jan 2019 17:14:36 -0800 Message-Id: <20190122011436.18408-1-blp@ovn.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH] seq: Correct example in comment. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org It was deceptive for the example to imply that a seq can be declared directly, because the API only allows for creating a new one on the heap. Signed-off-by: Ben Pfaff Acked-by: Ilya Maximets --- lib/seq.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/seq.h b/lib/seq.h index 221ab9acddc5..92743c1eb4ea 100644 --- a/lib/seq.h +++ b/lib/seq.h @@ -77,14 +77,14 @@ * * struct ovs_mutex mutex; * struct ovs_list queue OVS_GUARDED_BY(mutex); - * struct seq nonempty_seq; + * struct seq *nonempty_seq; * * To add an element to the queue: * * ovs_mutex_lock(&mutex); * ovs_list_push_back(&queue, ...element...); * if (ovs_list_is_singleton(&queue)) { // The 'if' test here is optional. - * seq_change(&nonempty_seq); + * seq_change(nonempty_seq); * } * ovs_mutex_unlock(&mutex); * @@ -92,7 +92,7 @@ * * ovs_mutex_lock(&mutex); * if (ovs_list_is_empty(&queue)) { - * seq_wait(&nonempty_seq, seq_read(&nonempty_seq)); + * seq_wait(nonempty_seq, seq_read(nonempty_seq)); * } else { * poll_immediate_wake(); * }