Received: by 10.223.164.200 with SMTP id h8csp640411wrb; Sun, 5 Nov 2017 17:27:53 -0800 (PST) X-Google-Smtp-Source: ABhQp+QS1gZ20N7h0/bz+RWFo8/LnOEqNts09iEv/PjpFW4AmOLnUel8rFYdnwT+DFHfn46VyczT X-Received: by 10.84.229.77 with SMTP id d13mr13025784pln.397.1509931673508; Sun, 05 Nov 2017 17:27:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509931673; cv=none; d=google.com; s=arc-20160816; b=m1CJo1xR6Zn/brZGtTzNAVSpSW4FUe5vQ93okGGSKb/fGGrb3O4KbmOobqMik9Nl9b BJzXNjPomOrYzqmoF9B22unPjYz6NOI99cLQEMbKcpvd2fmNME/+RFRqxU72avRq8pap X9pxIHhO/MTtkZfK+qmoTGJLefvDVWRIMHmAEwagRPSdT175eTM9E14LGQcj49nh64lB SH50+tNmccqotugJgCPto+OZL7EgIbU7srR+8KtKqMT4QmJ1Ccjb+X9/+QN+IW7VCdbu p754rV9dwohbsjbFpty+O+g14eeVKvo/ES5TELj3ywL1IhyZ05jkaKl4+3nms9qtPNG0 1ZOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=FQJzoE9QaMIpzMG5GvBvWCjAWXza2jNPkpjqpMz6Qr0=; b=le9gzdFDhBZHhljt7jqqCORKlX4Bcagt5ZuSsaeooUDfahpiQhRXjmjXUO/mjg3rEE jiCX1Z3UlPQFy0VVAemW+CZ+J4mTN4MkZGLgcONYzyHyn5Wl6mm5b5NaCALF3cTLhjKb lvtvmj/149E3PU826Obw2t3aLBcVSdWKwOHrNVKaD1FfSCYeRLEPN9JdCM+ahFUpUomB qS6t/iRB5YGJ1l7l7k4T6noxSlIxhRqb6fCnXeuZPfdyCTUF+x+QTbZKp5Gr+yzllMUJ yMNN6gKAPuzZhDz2kJg40wvzSVveYFLtSspzQ201ehjv9XXi9/Xh/2UrEbPyRsCfbxrZ jp+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=ebuCAoGg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si9524161plp.765.2017.11.05.17.27.40; Sun, 05 Nov 2017 17:27:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=ebuCAoGg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbdKFB0o (ORCPT + 96 others); Sun, 5 Nov 2017 20:26:44 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46687 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdKFB0Q (ORCPT ); Sun, 5 Nov 2017 20:26:16 -0500 Received: by mail-wm0-f67.google.com with SMTP id r68so10765265wmr.1 for ; Sun, 05 Nov 2017 17:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FQJzoE9QaMIpzMG5GvBvWCjAWXza2jNPkpjqpMz6Qr0=; b=ebuCAoGgHVdMii11Q+e9WQHEtkQrvR+vH5WaRDbvtHgD0T3KN+jZSlE3dfxm2qjdHa MTyxDMVp0z/5F8ZVgtOtkBktojYaf44hfsq9DiRibwWgh40j3KiqKhQZ9Mgir4YGp+9Y P/egyuqyZwUinDwBpALpdDTfl0CE5oNaDVA8YU8nHMhg//UyQaTMT3Xl2sxcxsiCjVJC jhRNI0Y9/JAtVpTa8XAWIqE/NoF5naW9fVcK8mXh2tJf2lx9boEHXz1lnoKGDLFLXvjU GQ0xUO070RY6dHGwXn1CNBRLm8vk5ztbmZRXs4pM+WUzplaCd3ETc4NJ8l7gCCQY75Rv cYoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FQJzoE9QaMIpzMG5GvBvWCjAWXza2jNPkpjqpMz6Qr0=; b=t+KQUWkc+hEbAhg6mZAGC14Cr+GceZE85R3iw9xP2OOrHZjQMRmz8b0+9bLgv5Cbmn d/ve4UxH9+tc7YbW4SFeM3fwqlA6brOOrfGjTSkCAQgfO02/Hx84Rfx4/1xjY462RrPK OUAptiic1dk26CZxq0qhnS9Q5dUY/kScIFyt0CAmAhq6SGcoM6gHeBFu3cHa3Hh5llup UzqZ1NAsyvt4qy0QMvZzpMUzMk9S7Kw01uYI2hvgW0dV9QD1FWiotYbgkmMnGKMYmurW Zu1gLAvCycHv1luMOL6nSl9RjQf9g4vLMYTt1gN66npIqZ+nWDz7QrceAKBgwCE53eb7 6EKg== X-Gm-Message-State: AMCzsaXvlvDxInoGDngeFS6KhCUEvYPgBSHL2PnprkfIzL8UJhbXviOC GCmJjNCpBc2hZV5fMwTpveSXuA== X-Received: by 10.80.205.212 with SMTP id h20mr18152750edj.157.1509931575027; Sun, 05 Nov 2017 17:26:15 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id c32sm10258015eda.57.2017.11.05.17.26.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Nov 2017 17:26:14 -0800 (PST) From: Bryan O'Donoghue To: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, keescook@chromium.org, linux-kernel@vger.kernel.org Cc: Bryan O'Donoghue , Mitch Tasman , greybus-dev@lists.linaro.org Subject: [PATCH v2 3/4] staging: greybus: operation: add private data with get/set accessors Date: Mon, 6 Nov 2017 01:26:10 +0000 Message-Id: <1509931571-24621-4-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509931571-24621-1-git-send-email-pure.logic@nexus-software.ie> References: <1509931571-24621-1-git-send-email-pure.logic@nexus-software.ie> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Asynchronous operation completion handler's lives are made easier if there is a generic pointer that can store private data associated with the operation. This patch adds a pointer field to struct gb_operation and get/set methods to access that pointer. Signed-off-by: Bryan O'Donoghue Cc: Johan Hovold Cc: Alex Elder Cc: Greg Kroah-Hartman Cc: Mitch Tasman Cc: greybus-dev@lists.linaro.org Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Johan Hovold --- drivers/staging/greybus/operation.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h index 7529f01..bfec1e9 100644 --- a/drivers/staging/greybus/operation.h +++ b/drivers/staging/greybus/operation.h @@ -105,6 +105,8 @@ struct gb_operation { int active; struct list_head links; /* connection->operations */ + + void *private; }; static inline bool @@ -206,6 +208,17 @@ static inline int gb_operation_unidirectional(struct gb_connection *connection, request, request_size, GB_OPERATION_TIMEOUT_DEFAULT); } +static inline void *gb_operation_get_data(struct gb_operation *operation) +{ + return operation->private; +} + +static inline void gb_operation_set_data(struct gb_operation *operation, + void *data) +{ + operation->private = data; +} + int gb_operation_init(void); void gb_operation_exit(void); -- 2.7.4 From 1583364335982183266@xxx Tue Nov 07 00:18:20 +0000 2017 X-GM-THRID: 1583364335982183266 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread