lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon,  6 Nov 2017 01:32:21 +0000
From:   Bryan O'Donoghue <pure.logic@...us-software.ie>
To:     johan@...nel.org, elder@...nel.org, gregkh@...uxfoundation.org,
        devel@...verdev.osuosl.org, keescook@...omium.org,
        linux-kernel@...r.kernel.org
Cc:     Bryan O'Donoghue <pure.logic@...us-software.ie>,
        Mitch Tasman <tasman@...flabs.com>,
        greybus-dev@...ts.linaro.org
Subject: [PATCH v3 3/4] staging: greybus: operation: add private data with get/set accessors

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 <pure.logic@...us-software.ie>
Cc: Johan Hovold <johan@...nel.org>
Cc: Alex Elder <elder@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Mitch Tasman <tasman@...flabs.com>
Cc: greybus-dev@...ts.linaro.org
Cc: devel@...verdev.osuosl.org
Cc: linux-kernel@...r.kernel.org
Reviewed-by: Johan Hovold <johan@...nel.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

Powered by blists - more mailing lists