Received: by 10.223.164.200 with SMTP id h8csp644759wrb; Sun, 5 Nov 2017 17:35:05 -0800 (PST) X-Google-Smtp-Source: ABhQp+TKt4ZfSRR72RYIapZqMi86NTB4RSg6nsBrNigAZ17CJviIkQEBAMR7SIY4iw+Ds8XYmtic X-Received: by 10.99.188.9 with SMTP id q9mr13898053pge.104.1509932104978; Sun, 05 Nov 2017 17:35:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509932104; cv=none; d=google.com; s=arc-20160816; b=gYtDvr0YfaT7QEPCFTewHlhUS155kEGt+UFjTCip/f+L8Tr01HWZQhMqR+D8kcWJ5y /lRS27W2iVZqt160xZ2FIzVygIBckekc4JLGULiU01+OWxzDqJe+vCmzSYzZVCRYrQ1f So5ATlFpS1Pei5dLNXsuUI/h34HfmpJwC9ukya+gwHVO9e4bxE3mN0RfTNjQMiijUwKJ hfv3RltLo8stRLZxOHo7x1d1iwsqbnUx3sAMDsWJ0blQeyRRLJ8aBXdSBDnxDxwJc5ZP klsWBELbyRNNtYXC5DCB9L0KydrhJJSXcs1zk6jbOZCHyPAGGL9leSSj9raCzgYS24lk aJDw== 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=XrFuPxTRe3KM77nlWcraF4GDoEJ8WQY4b3jhKb7aQpu4AHg2VHF5gk0npW3GKFCiJz +gbmhvROOAXM8391hds8R73At8dST0BfsXGGrUAaKxVABT0PDmCIeKCfqI+O2LqOuhtY oGlW8rp1Q/t6To8CBO6prWq8lyc4HU3iOq+kVRos6Rt9AavDHX8m9DdEvuOUafMKBpwD xGvUMq1/Q5vnlGlcsmy/FTIdbo5klhkU53yFuaMjUps9USm/eXOzAAv1d/lINk2+OYL3 wvZHIWbKy0T8sOk8xey6llqBhe9RUXe3b2YmC32F/WRcFYxLm58aMnFuOEzpVPAIjUfC iSqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=b8loTSm0; 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 x85si11303982pff.344.2017.11.05.17.34.51; Sun, 05 Nov 2017 17:35:04 -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=b8loTSm0; 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 S1751755AbdKFBcp (ORCPT + 96 others); Sun, 5 Nov 2017 20:32:45 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:49444 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561AbdKFBc1 (ORCPT ); Sun, 5 Nov 2017 20:32:27 -0500 Received: by mail-wm0-f65.google.com with SMTP id b189so10688238wmd.4 for ; Sun, 05 Nov 2017 17:32:27 -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=b8loTSm0zGGgR09xBpzKdckc88ImuPQ+sL145VpKyit99nehdaka95CMWIfj9XGd54 3P/IAEMO2zXcTEupx3C6LdmZJCNHKGpnwvk0fFe1ZP3UxTbPMQnnESLGSwoArrwKLFRc Fv6iK7slpCV3HEHCtFyvc0x5Tk9GsPWnkHNy72Avdncxv9muZjvsWsJm0XXZR2gKSs4g KNCwHDtgWtR90aOeUIj9YZdMziA/+V8TiYAwW1Dg9o8mmsLJtLWuMJwfBPqSniuC4l/c IbsQVIvhOO2xlnwDSIiyS4uL632ynm+OlWzkInc0Bas2/O87Oldtvfvpf12YvOaY/VkQ XuzQ== 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=D6pDQtsVAfbKGaqS2puCca6zSr8k/2XjZGcp2+syKtOHNtXk3AlxHtGZQuqZXoy54t VhI2lRhKjM5AZhAw6cooUtb7MtOyR6FxxkOupSEHx/nfxwWha8ud54R0+YZA00i/z6aW pJzggWc2Mebtb3iyjLWahruZL1fx1CZ49qZ038KugUrshHeCS+PECwB2wP6GRVsGHrf7 NsQ8ZfQd3XsmcLHVumpM+DZKHy2ga3YZuNSwdTEtKKNraWe2JqWo6GmgOg8fo+uQSfIP iq/saMcspnL++qokCMPIJFEdGzOEna24Bm9MoVBX669O16OdcPRjAkRYKnl8s8lcJ0rW siCw== X-Gm-Message-State: AMCzsaUUfIPmz5u9IyAG62wEh7WyjH7E8/mr32FLETxywjV3JUk/snQZ lWh9HPRb/jcRjyvXdDRSVdKYmg== X-Received: by 10.80.134.215 with SMTP id 23mr18328904edu.129.1509931946712; Sun, 05 Nov 2017 17:32:26 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id c7sm10603213edc.26.2017.11.05.17.32.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Nov 2017 17:32:26 -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 v3 3/4] staging: greybus: operation: add private data with get/set accessors Date: Mon, 6 Nov 2017 01:32:21 +0000 Message-Id: <1509931942-25712-4-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509931942-25712-1-git-send-email-pure.logic@nexus-software.ie> References: <1509931942-25712-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 1583278114043220848@xxx Mon Nov 06 01:27:53 +0000 2017 X-GM-THRID: 1583278114043220848 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread