lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] vdpa: Add documentation for vdpa_alloc_device() macro
On Thu, Jul 15, 2021 at 04:00:26PM +0800, Xie Yongji wrote:
>The return value of vdpa_alloc_device() macro is not very
>clear, so that most of callers did the wrong check. Let's
>add some comments to better document it.
>
>Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
>---
> include/linux/vdpa.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
>diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
>index 3357ac98878d..8cfe49d201dd 100644
>--- a/include/linux/vdpa.h
>+++ b/include/linux/vdpa.h
>@@ -277,6 +277,17 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,
> const struct vdpa_config_ops *config,
> size_t size, const char *name);
>
>+/**
>+ * vdpa_alloc_device - allocate and initilaize a vDPA device
>+ *
>+ * @dev_struct: the type of the parent structure
>+ * @member: the name of struct vdpa_device within the @dev_struct
>+ * @parent: the parent device
>+ * @config: the bus operations that is supported by this device
>+ * @name: name of the vdpa device
>+ *
>+ * Return allocated data structure or ERR_PTR upon error
>+ */
> #define vdpa_alloc_device(dev_struct, member, parent, config, name) \
> container_of(__vdpa_alloc_device( \
> parent, config, \
>--
>2.11.0
>

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

\
 
 \ /
  Last update: 2021-07-26 11:31    [W:0.054 / U:2.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site