From patchwork Mon Feb 16 06:57:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 23203 X-Patchwork-Delegate: jk@ozlabs.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id DD84ADDD1B for ; Mon, 16 Feb 2009 18:03:02 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from hera.kernel.org (hera.kernel.org [140.211.167.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A46A8DDD1C; Mon, 16 Feb 2009 18:02:57 +1100 (EST) Received: from hera.kernel.org (IDENT:U2FsdGVkX1+cmt4xaLstUyx5A3Y1nrvTTk3D7hdnh/s@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n1G72pkU021634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Feb 2009 07:02:51 GMT Received: (from geoff@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n1G72pkv021633; Mon, 16 Feb 2009 07:02:51 GMT Message-Id: <20090216065712.711326298@am.sony.com> References: <20090216065712.595147007@am.sony.com> In-reply-to: <20090216065712.595147007@am.sony.com> User-Agent: quilt/0.46-1 Date: Sun, 15 Feb 2009 22:57:13 -0800 From: Geoff Levand To: Jeremy Kerr Content-Disposition: inline; filename=client-cb-arg-to-init.diff X-Virus-Scanned: ClamAV 0.93.3/8994/Sun Feb 15 23:37:25 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Mon, 16 Feb 2009 07:02:53 +0000 (UTC) Cc: cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [patch 1/8] petitboot: Pass cb_arg to discover_client_init X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Pass the client cb_arg to discover_client_init() and have it initialize the structure member. Signed-off-by: Geoff Levand --- ui/common/discover-client.c | 3 ++- ui/common/discover-client.h | 2 +- ui/test/pb-test.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -33,7 +33,7 @@ static int discover_client_destructor(vo } struct discover_client* discover_client_init( - const struct discover_client_ops *ops) + const struct discover_client_ops *ops, void* cb_arg) { struct discover_client *client; struct sockaddr_un addr; @@ -43,6 +43,7 @@ struct discover_client* discover_client_ return NULL; memcpy(&client->ops, ops, sizeof(client->ops)); + client->ops.cb_arg = cb_arg; client->fd = socket(AF_UNIX, SOCK_STREAM, 0); if (!client->fd < 0) { --- a/ui/common/discover-client.h +++ b/ui/common/discover-client.h @@ -19,7 +19,7 @@ struct discover_client_ops { }; struct discover_client *discover_client_init( - const struct discover_client_ops *ops); + const struct discover_client_ops *ops, void* cb_arg); int discover_client_get_fd(const struct discover_client *client); --- a/ui/test/pb-test.c +++ b/ui/test/pb-test.c @@ -45,7 +45,7 @@ int main(void) { struct discover_client *client; - client = discover_client_init(&client_ops); + client = discover_client_init(&client_ops, NULL); if (!client) return -1;