Received: by 10.223.164.197 with SMTP id h5csp617107wrb; Sat, 4 Nov 2017 20:29:31 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TkJYbK9Dl7OQnlSzGeTLqDmbNL7ArQYkPVsiNSUKIiSaVw7jpo33YOv39Z+/Ic4rfNj/Lq X-Received: by 10.159.198.131 with SMTP id g3mr11197605plo.337.1509852571560; Sat, 04 Nov 2017 20:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509852571; cv=none; d=google.com; s=arc-20160816; b=DvuEgVaDehi0XZ3/d2S8HyQSXl1mYW+F5WHrKRhtZ7TD0h9hS4kqVcFvXh9JVnR4u+ F1VIx3gZE8h1MpA5KWwV+zZyU679eopUe6aUoJOd9yrsNjG8h8gswnGui3n/y3fdOcHL 6pxFfrEOsQcbH6DxnxTYwWImOuIijUVm3yEk+L1gmlVS2BCkK7KTCqVastN5bHhx1dzf b5b0GYIOe8kOAfJpQE/s138XNFQBWCMFq8n6LH86umH4Ooi9hk9i4RKyIBhfoH7YTfZx FABwxiytgmrPZyTFNpCnU4Pqf7uDE37MYDQiBdIrZnO7Rab4q7iV4I1fNgFkxi0fj1WZ imsA== 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=RnNdlHp+Va7kgy0hBjcg8voykPQ9qQe1G0TjBk31PMw=; b=De8EODxeMpizdXDwHCOuZWchjXtsMekhu2/iP/nUATwgcsELkv8ZeY8sWheqioywWQ j0u1HNMAqq+Bphgd26JQKBMqVkGKsoLt8pWwHOjz+SO67TBTc31VjVlZpOlBKSrGMs9I JXjQ4fEEzgbkq3MEKJ7JJkbCqiLTPRsYjUjCUHGBOYZCiYkfoeIanqCJrUnxYrzPyFzg AcMpEzodMjuokn54XrLrF0px9AZC1ZhAkodFkLtUzKrAFkMTAoGAGwDN8SFTYdNOk4PE hn2BsRT9m58ZzjDbT9PBeP2WHj3KZQL7zmDjltiuJ7YgENXjeLKDWu4ZBrkCfqH7iqx1 cZ2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=1sKozbmg; 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 p26si7837629pli.781.2017.11.04.20.29.18; Sat, 04 Nov 2017 20:29:31 -0700 (PDT) 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=1sKozbmg; 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 S1752682AbdKED2H (ORCPT + 94 others); Sat, 4 Nov 2017 23:28:07 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:52753 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbdKED1m (ORCPT ); Sat, 4 Nov 2017 23:27:42 -0400 Received: by mail-wm0-f65.google.com with SMTP id t139so8140191wmt.1 for ; Sat, 04 Nov 2017 20:27:42 -0700 (PDT) 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=RnNdlHp+Va7kgy0hBjcg8voykPQ9qQe1G0TjBk31PMw=; b=1sKozbmgnILKDNyCKr1F8KpaGMyig0A5DWO0MWep69FBP1YfD7sFRdmuNnh6MpAiWm zCEKt31FM3q+0LowHwHDaZSrXtrC3TzTMnMQTKuEd7EpKuGWPeK24bP7ik53RWHNqSfQ oGe9wmyi5134cmw1IQipD+JeuyrV5KEurdbAXSKItQuntbHa+HpdAfq7hJ9SB1vpkNWs hztXChnnmCzmapQKf3T3EUeKoAY2wpK2DxxYyx/WjzJBaW1BQtxKnXq2VYCM7pGZQGpd /zPVJUJSctHdLcK2Yp8/sjfg5WKtsB9YWqK+JReRkcQTcRzQ2mtJFXrEsc86WTKA16V1 PBwA== 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=RnNdlHp+Va7kgy0hBjcg8voykPQ9qQe1G0TjBk31PMw=; b=YXGveNbdluyKthCl/9AmzzYZ4FQsJP3ZUqIm555ZzXIHkmMn5gsVRD6rhSWOFYlHm/ L+Y3cAihKBvvqrOT9GMa+n91uPqkEPjoAp4MGPhwXVwg4W+2gyIUoeErSG9quNTr1WRx k+I2EaZepi18OK4opJLnONZTW2R37q/TunC1MsyUoPFrQHd9MBi0wcengdQ+wCUdS3r7 o31m2prppb5yq9L5MgbWtQPSedoHU454SgGvlMuXqOIxTF6RM3wIzEybVrtBbM/tHU+T 44g6AQM7RBGEq9fkkjfE/PjEhUDn6HHHPmKLPFrxv3qcDqiJZGmnMMCyFgCd5ePZaFAa 9uJA== X-Gm-Message-State: AMCzsaUw8eaYgFkC3vx8k6Qy42XeiyF1zgSWmPgpuCU0vffFK5+JFVN9 RG1NViu+Ky+hOAASXGoaIAzVSw== X-Received: by 10.80.142.17 with SMTP id 17mr15001380edw.115.1509852461508; Sat, 04 Nov 2017 20:27:41 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a1sm8075536edb.37.2017.11.04.20.27.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Nov 2017 20:27:41 -0700 (PDT) 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 , greybus-dev@lists.linaro.org Subject: [PATCH 1/2] staging: greybus: operation: add private data with get/set accessors Date: Sun, 5 Nov 2017 03:27:38 +0000 Message-Id: <1509852459-5847-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509852459-5847-1-git-send-email-pure.logic@nexus-software.ie> References: <1509852459-5847-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 operation.h 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: greybus-dev@lists.linaro.org Cc: devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org --- 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 1583352079062859000@xxx Mon Nov 06 21:03:31 +0000 2017 X-GM-THRID: 1581638883454797945 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread