mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Ian Munsie <imunsie@au1.ibm.com>
Cc: mikey <mikey@neuling.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linuxppc-dev <linuxppc-dev@ozlabs.org>,
	Matt Ochs <mrochs@us.ibm.com>
Subject: Re: [PATCH 2/2] cxl: add set/get private data to context struct
Date: Wed, 19 Aug 2015 14:49:30 +1000	[thread overview]
Message-ID: <1439959770.24918.5.camel@ellerman.id.au> (raw)
In-Reply-To: <1439957971-30483-2-git-send-email-imunsie@au.ibm.com>

On Wed, 2015-08-19 at 14:19 +1000, Ian Munsie wrote:
> From: Michael Neuling <mikey@neuling.org>
> 
> This provides AFU drivers a means to associate private data with a cxl
> context. This is particularly intended for make the new callbacks for
> driver specific events easier for AFU drivers to use, as they can easily
> get back to any private data structures they may use.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
> ---
>  drivers/misc/cxl/api.c | 21 +++++++++++++++++++++
>  drivers/misc/cxl/cxl.h |  3 +++
>  include/misc/cxl.h     |  7 +++++++
>  3 files changed, 31 insertions(+)
> 
> diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
> index e0f0c78..5f0b22e 100644
> --- a/drivers/misc/cxl/api.c
> +++ b/drivers/misc/cxl/api.c
> @@ -70,6 +70,27 @@ int cxl_release_context(struct cxl_context *ctx)
>  }
>  EXPORT_SYMBOL_GPL(cxl_release_context);
>  
> +
> +int cxl_set_priv(struct cxl_context *ctx, void *priv)
> +{
> +	if (!ctx)
> +		return -EINVAL;
> +
> +	ctx->priv = priv;
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(cxl_set_priv);
> +
> +void *cxl_get_priv(struct cxl_context *ctx)
> +{
> +	if (!ctx)
> +		return ERR_PTR(-EINVAL);
> +
> +	return ctx->priv;
> +}
> +EXPORT_SYMBOL_GPL(cxl_get_priv);


Do we really need the accessors? They don't buy anything I can see over just
using ctx->priv directly.

cheers



  reply	other threads:[~2015-08-19  4:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19  4:19 [PATCH 1/2] cxl: Add mechanism for delivering AFU driver specific events Ian Munsie
2015-08-19  4:19 ` [PATCH 2/2] cxl: add set/get private data to context struct Ian Munsie
2015-08-19  4:49   ` Michael Ellerman [this message]
2015-08-19  5:12     ` Ian Munsie
2015-08-19  5:33       ` Michael Ellerman
2015-08-19  5:30 ` [PATCH 1/2] cxl: Add mechanism for delivering AFU driver specific events Michael Ellerman
2015-08-19  7:03   ` Ian Munsie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439959770.24918.5.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=imunsie@au1.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mrochs@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®