diff mbox series

[v4,06/15] dmaengine: idxd: Add wq private data accessors

Message ID 038db785a87dc59c0073989633eee0205958cb67.1683573703.git.zanussi@kernel.org
State Superseded
Headers show
Series crypto: Add Intel Analytics Accelerator (IAA) crypto compression driver | expand

Commit Message

Tom Zanussi May 8, 2023, 8:07 p.m. UTC
Add the accessors set_idxd_wq_private() and idxd_wq_private() allowing
users to set and retrieve a private void * associated with an idxd_wq.

The private data is stored in the idxd_dev.conf_dev associated with
each idxd_wq.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 drivers/dma/idxd/idxd.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Dave Jiang May 8, 2023, 8:43 p.m. UTC | #1
On 5/8/23 1:07 PM, Tom Zanussi wrote:
> Add the accessors set_idxd_wq_private() and idxd_wq_private() allowing
> users to set and retrieve a private void * associated with an idxd_wq.
> 
> The private data is stored in the idxd_dev.conf_dev associated with
> each idxd_wq.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---
>   drivers/dma/idxd/idxd.h | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
> index 193552dea224..71cd4ca7d27a 100644
> --- a/drivers/dma/idxd/idxd.h
> +++ b/drivers/dma/idxd/idxd.h
> @@ -552,6 +552,16 @@ static inline int idxd_wq_refcount(struct idxd_wq *wq)
>   	return wq->client_count;
>   };
>   
> +static inline void set_idxd_wq_private(struct idxd_wq *wq, void *private)

I would go with the same kernel naming convention:

idxd_wq_set_private() and idxd_wq_get_private()?
> +{
> +	dev_set_drvdata(wq_confdev(wq), private);
> +}
> +
> +static inline void *idxd_wq_private(struct idxd_wq *wq)
> +{
> +	return dev_get_drvdata(wq_confdev(wq));
> +}
> +
>   /*
>    * Intel IAA does not support batch processing.
>    * The max batch size of device, max batch size of wq and
diff mbox series

Patch

diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
index 193552dea224..71cd4ca7d27a 100644
--- a/drivers/dma/idxd/idxd.h
+++ b/drivers/dma/idxd/idxd.h
@@ -552,6 +552,16 @@  static inline int idxd_wq_refcount(struct idxd_wq *wq)
 	return wq->client_count;
 };
 
+static inline void set_idxd_wq_private(struct idxd_wq *wq, void *private)
+{
+	dev_set_drvdata(wq_confdev(wq), private);
+}
+
+static inline void *idxd_wq_private(struct idxd_wq *wq)
+{
+	return dev_get_drvdata(wq_confdev(wq));
+}
+
 /*
  * Intel IAA does not support batch processing.
  * The max batch size of device, max batch size of wq and