linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Xie Yongji <xieyongji@bytedance.com>
Cc: mst@redhat.com, jasowang@redhat.com, dan.carpenter@oracle.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] vdpa: Add documentation for vdpa_alloc_device() macro
Date: Mon, 26 Jul 2021 11:29:42 +0200	[thread overview]
Message-ID: <20210726092942.cyh4djfevy7vcgjc@steredhat> (raw)
In-Reply-To: <20210715080026.242-4-xieyongji@bytedance.com>

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>


  parent reply	other threads:[~2021-07-26  9:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  8:00 [PATCH 1/4] vdpa_sim: Fix return value check for vdpa_alloc_device() Xie Yongji
2021-07-15  8:00 ` [PATCH 2/4] vp_vdpa: " Xie Yongji
2021-07-15  8:08   ` Jason Wang
2021-07-26  9:28   ` Stefano Garzarella
2021-07-15  8:00 ` [PATCH 3/4] vDPA/ifcvf: " Xie Yongji
2021-07-15  8:09   ` Jason Wang
2021-07-26  9:28   ` Stefano Garzarella
2021-07-15  8:00 ` [PATCH 4/4] vdpa: Add documentation for vdpa_alloc_device() macro Xie Yongji
2021-07-15  8:10   ` Jason Wang
2021-07-26  9:29   ` Stefano Garzarella [this message]
2021-07-26  9:28 ` [PATCH 1/4] vdpa_sim: Fix return value check for vdpa_alloc_device() Stefano Garzarella

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=20210726092942.cyh4djfevy7vcgjc@steredhat \
    --to=sgarzare@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xieyongji@bytedance.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;
as well as URLs for NNTP newsgroup(s).