All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Sumit Semwal <sumit.semwal@linaro.org>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-arm-kernel@lists.infradead.org,
	rmk+kernel@arm.linux.org.uk, airlied@linux.ie, kgene@kernel.org,
	daniel.vetter@intel.com, thierry.reding@gmail.com,
	pawel@osciak.com, m.szyprowski@samsung.com,
	mchehab@osg.samsung.com, gregkh@linuxfoundation.org
Cc: linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linaro-kernel@lists.linaro.org
Subject: Re: [PATCH v3] dma-buf: cleanup dma_buf_export() to make it easily extensible
Date: Tue, 03 Feb 2015 09:29:21 +0000	[thread overview]
Message-ID: <54D094F1.50404@linaro.org> (raw)
In-Reply-To: <1422449643-7829-1-git-send-email-sumit.semwal@linaro.org>

On 28/01/15 12:54, Sumit Semwal wrote:
> At present, dma_buf_export() takes a series of parameters, which
> makes it difficult to add any new parameters for exporters, if required.
> 
> Make it simpler by moving all these parameters into a struct, and pass
> the struct * as parameter to dma_buf_export().
> 
> While at it, unite dma_buf_export_named() with dma_buf_export(), and
> change all callers accordingly.
> 
> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>

Sorry, a few more comments. Should have sent these before but at least
the are all related only to documentation. Once that is fixed then:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


> ---
> v3: Daniel Thompson caught the C99 warning issue w/ using {0}; using
>     {.exp_name = xxx} instead.
> 
> v2: add macro to zero out local struct, and fill KBUILD_MODNAME by default
> 
>  drivers/dma-buf/dma-buf.c                      | 47 +++++++++++++-------------
>  drivers/gpu/drm/armada/armada_gem.c            | 10 ++++--
>  drivers/gpu/drm/drm_prime.c                    | 12 ++++---
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c     |  9 +++--
>  drivers/gpu/drm/i915/i915_gem_dmabuf.c         | 10 ++++--
>  drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c      |  9 ++++-
>  drivers/gpu/drm/tegra/gem.c                    | 10 ++++--
>  drivers/gpu/drm/ttm/ttm_object.c               |  9 +++--
>  drivers/gpu/drm/udl/udl_dmabuf.c               |  9 ++++-
>  drivers/media/v4l2-core/videobuf2-dma-contig.c |  8 ++++-
>  drivers/media/v4l2-core/videobuf2-dma-sg.c     |  8 ++++-
>  drivers/media/v4l2-core/videobuf2-vmalloc.c    |  8 ++++-
>  drivers/staging/android/ion/ion.c              |  9 +++--
>  include/linux/dma-buf.h                        | 34 +++++++++++++++----

Documentation/dma-buf-sharing.txt needs updating as a result of these
changes but its not in the diffstat.


>  14 files changed, 142 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 5be225c2ba98..6d3df3dd9310 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -265,7 +265,7 @@ static inline int is_dma_buf_file(struct file *file)
>  }
>  
>  /**
> - * dma_buf_export_named - Creates a new dma_buf, and associates an anon file
> + * dma_buf_export - Creates a new dma_buf, and associates an anon file
>   * with this buffer, so it can be exported.
>   * Also connect the allocator specific data and ops to the buffer.
>   * Additionally, provide a name string for exporter; useful in debugging.
> @@ -277,31 +277,32 @@ static inline int is_dma_buf_file(struct file *file)
>   * @exp_name:	[in]	name of the exporting module - useful for debugging.
>   * @resv:	[in]	reservation-object, NULL to allocate default one.
>   *
> + * All the above info comes from struct dma_buf_export_info.
> + *

I'm not at all sure about this. Its a novel trick but won't this make
the HTML docs come out looking a bit weird? Is there any prior art for
double-documenting the structure members like this?


Daniel.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Sumit Semwal <sumit.semwal@linaro.org>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-arm-kernel@lists.infradead.org,
	rmk+kernel@arm.linux.org.uk, airlied@linux.ie, kgene@kernel.org,
	daniel.vetter@intel.com, thierry.reding@gmail.com,
	pawel@osciak.com, m.szyprowski@samsung.com,
	mchehab@osg.samsung.com, gregkh@linuxfoundation.org
Cc: linaro-kernel@lists.linaro.org, intel-gfx@lists.freedesktop.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH v3] dma-buf: cleanup dma_buf_export() to make it easily extensible
Date: Tue, 03 Feb 2015 09:29:21 +0000	[thread overview]
Message-ID: <54D094F1.50404@linaro.org> (raw)
In-Reply-To: <1422449643-7829-1-git-send-email-sumit.semwal@linaro.org>

On 28/01/15 12:54, Sumit Semwal wrote:
> At present, dma_buf_export() takes a series of parameters, which
> makes it difficult to add any new parameters for exporters, if required.
> 
> Make it simpler by moving all these parameters into a struct, and pass
> the struct * as parameter to dma_buf_export().
> 
> While at it, unite dma_buf_export_named() with dma_buf_export(), and
> change all callers accordingly.
> 
> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>

Sorry, a few more comments. Should have sent these before but at least
the are all related only to documentation. Once that is fixed then:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


> ---
> v3: Daniel Thompson caught the C99 warning issue w/ using {0}; using
>     {.exp_name = xxx} instead.
> 
> v2: add macro to zero out local struct, and fill KBUILD_MODNAME by default
> 
>  drivers/dma-buf/dma-buf.c                      | 47 +++++++++++++-------------
>  drivers/gpu/drm/armada/armada_gem.c            | 10 ++++--
>  drivers/gpu/drm/drm_prime.c                    | 12 ++++---
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c     |  9 +++--
>  drivers/gpu/drm/i915/i915_gem_dmabuf.c         | 10 ++++--
>  drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c      |  9 ++++-
>  drivers/gpu/drm/tegra/gem.c                    | 10 ++++--
>  drivers/gpu/drm/ttm/ttm_object.c               |  9 +++--
>  drivers/gpu/drm/udl/udl_dmabuf.c               |  9 ++++-
>  drivers/media/v4l2-core/videobuf2-dma-contig.c |  8 ++++-
>  drivers/media/v4l2-core/videobuf2-dma-sg.c     |  8 ++++-
>  drivers/media/v4l2-core/videobuf2-vmalloc.c    |  8 ++++-
>  drivers/staging/android/ion/ion.c              |  9 +++--
>  include/linux/dma-buf.h                        | 34 +++++++++++++++----

Documentation/dma-buf-sharing.txt needs updating as a result of these
changes but its not in the diffstat.


>  14 files changed, 142 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 5be225c2ba98..6d3df3dd9310 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -265,7 +265,7 @@ static inline int is_dma_buf_file(struct file *file)
>  }
>  
>  /**
> - * dma_buf_export_named - Creates a new dma_buf, and associates an anon file
> + * dma_buf_export - Creates a new dma_buf, and associates an anon file
>   * with this buffer, so it can be exported.
>   * Also connect the allocator specific data and ops to the buffer.
>   * Additionally, provide a name string for exporter; useful in debugging.
> @@ -277,31 +277,32 @@ static inline int is_dma_buf_file(struct file *file)
>   * @exp_name:	[in]	name of the exporting module - useful for debugging.
>   * @resv:	[in]	reservation-object, NULL to allocate default one.
>   *
> + * All the above info comes from struct dma_buf_export_info.
> + *

I'm not at all sure about this. Its a novel trick but won't this make
the HTML docs come out looking a bit weird? Is there any prior art for
double-documenting the structure members like this?


Daniel.

WARNING: multiple messages have this Message-ID (diff)
From: daniel.thompson@linaro.org (Daniel Thompson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] dma-buf: cleanup dma_buf_export() to make it easily extensible
Date: Tue, 03 Feb 2015 09:29:21 +0000	[thread overview]
Message-ID: <54D094F1.50404@linaro.org> (raw)
In-Reply-To: <1422449643-7829-1-git-send-email-sumit.semwal@linaro.org>

On 28/01/15 12:54, Sumit Semwal wrote:
> At present, dma_buf_export() takes a series of parameters, which
> makes it difficult to add any new parameters for exporters, if required.
> 
> Make it simpler by moving all these parameters into a struct, and pass
> the struct * as parameter to dma_buf_export().
> 
> While at it, unite dma_buf_export_named() with dma_buf_export(), and
> change all callers accordingly.
> 
> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>

Sorry, a few more comments. Should have sent these before but at least
the are all related only to documentation. Once that is fixed then:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


> ---
> v3: Daniel Thompson caught the C99 warning issue w/ using {0}; using
>     {.exp_name = xxx} instead.
> 
> v2: add macro to zero out local struct, and fill KBUILD_MODNAME by default
> 
>  drivers/dma-buf/dma-buf.c                      | 47 +++++++++++++-------------
>  drivers/gpu/drm/armada/armada_gem.c            | 10 ++++--
>  drivers/gpu/drm/drm_prime.c                    | 12 ++++---
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c     |  9 +++--
>  drivers/gpu/drm/i915/i915_gem_dmabuf.c         | 10 ++++--
>  drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c      |  9 ++++-
>  drivers/gpu/drm/tegra/gem.c                    | 10 ++++--
>  drivers/gpu/drm/ttm/ttm_object.c               |  9 +++--
>  drivers/gpu/drm/udl/udl_dmabuf.c               |  9 ++++-
>  drivers/media/v4l2-core/videobuf2-dma-contig.c |  8 ++++-
>  drivers/media/v4l2-core/videobuf2-dma-sg.c     |  8 ++++-
>  drivers/media/v4l2-core/videobuf2-vmalloc.c    |  8 ++++-
>  drivers/staging/android/ion/ion.c              |  9 +++--
>  include/linux/dma-buf.h                        | 34 +++++++++++++++----

Documentation/dma-buf-sharing.txt needs updating as a result of these
changes but its not in the diffstat.


>  14 files changed, 142 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 5be225c2ba98..6d3df3dd9310 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -265,7 +265,7 @@ static inline int is_dma_buf_file(struct file *file)
>  }
>  
>  /**
> - * dma_buf_export_named - Creates a new dma_buf, and associates an anon file
> + * dma_buf_export - Creates a new dma_buf, and associates an anon file
>   * with this buffer, so it can be exported.
>   * Also connect the allocator specific data and ops to the buffer.
>   * Additionally, provide a name string for exporter; useful in debugging.
> @@ -277,31 +277,32 @@ static inline int is_dma_buf_file(struct file *file)
>   * @exp_name:	[in]	name of the exporting module - useful for debugging.
>   * @resv:	[in]	reservation-object, NULL to allocate default one.
>   *
> + * All the above info comes from struct dma_buf_export_info.
> + *

I'm not at all sure about this. Its a novel trick but won't this make
the HTML docs come out looking a bit weird? Is there any prior art for
double-documenting the structure members like this?


Daniel.

  parent reply	other threads:[~2015-02-03  9:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 12:54 [PATCH v3] dma-buf: cleanup dma_buf_export() to make it easily extensible Sumit Semwal
2015-01-28 12:54 ` Sumit Semwal
2015-01-28 12:54 ` Sumit Semwal
2015-01-28 13:23 ` Mauro Carvalho Chehab
2015-01-28 13:23   ` Mauro Carvalho Chehab
2015-01-28 13:23   ` Mauro Carvalho Chehab
2015-01-28 13:30   ` Sumit Semwal
2015-01-28 13:30     ` Sumit Semwal
2015-01-28 13:30     ` Sumit Semwal
2015-01-28 13:30     ` Sumit Semwal
2015-01-28 15:00 ` Maarten Lankhorst
2015-01-28 15:00   ` Maarten Lankhorst
2015-01-28 15:00   ` Maarten Lankhorst
2015-02-03  9:29 ` Daniel Thompson [this message]
2015-02-03  9:29   ` Daniel Thompson
2015-02-03  9:29   ` Daniel Thompson

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=54D094F1.50404@linaro.org \
    --to=daniel.thompson@linaro.org \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kgene@kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel@osciak.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=sumit.semwal@linaro.org \
    --cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.