linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
@ 2020-03-17 17:06 Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2020-03-17 17:06 UTC (permalink / raw)
  To: LKML
  Cc: Daniel Vetter, linux-media, dri-devel, linaro-mm-sig,
	Joe Perches, Sumit Semwal, Daniel Vetter

We're getting some random other stuff that we're not relly interested
in, so match only word boundaries. Also avoid the capture group while
at it.

Suggested by Joe Perches.

Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: Joe Perches <joe@perches.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
v2: No single quotes in MAINTAINERS (Joe)
---
 MAINTAINERS                   |  2 +-
 drivers/gpu/drm/drm_managed.c | 27 +++++++++++++++++----------
 include/drm/drm_managed.h     |  2 +-
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3005be638c2c..ed6088a01bfe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5025,7 +5025,7 @@ F:	include/linux/dma-buf*
 F:	include/linux/reservation.h
 F:	include/linux/*fence.h
 F:	Documentation/driver-api/dma-buf.rst
-K:	dma_(buf|fence|resv)
+K:	\bdma_(?:buf|fence|resv)\b
 T:	git git://anongit.freedesktop.org/drm/drm-misc
 
 DMA-BUF HEAPS FRAMEWORK
diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c
index 5148ef786c3b..c256c9679eb5 100644
--- a/drivers/gpu/drm/drm_managed.c
+++ b/drivers/gpu/drm/drm_managed.c
@@ -52,6 +52,12 @@ struct drmres {
 	u8 __aligned(ARCH_KMALLOC_MINALIGN) data[];
 };
 
+static void free_dr(struct drmres *dr)
+{
+	kfree_const(dr->node.name);
+	kfree(dr);
+}
+
 void drm_managed_release(struct drm_device *dev)
 {
 	struct drmres *dr, *tmp;
@@ -65,13 +71,13 @@ void drm_managed_release(struct drm_device *dev)
 			dr->node.release(dev, dr->node.size ? *(void **)&dr->data : NULL);
 
 		list_del(&dr->node.entry);
-		kfree(dr);
+		free_dr(dr);
 	}
 	drm_dbg_drmres(dev, "drmres release end\n");
 }
 
 /*
- * Always inline so that kmallc_track_caller tracks the actual interesting
+ * Always inline so that kmalloc_track_caller tracks the actual interesting
  * caller outside of drm_managed.c.
  */
 static __always_inline struct drmres * alloc_dr(drmres_release_t release,
@@ -120,7 +126,7 @@ static void add_dr(struct drm_device *dev, struct drmres *dr)
 /**
  * drmm_add_final_kfree - add release action for the final kfree()
  * @dev: DRM device
- * @parent: pointer to the kmalloc allocation containing @dev
+ * @container: pointer to the kmalloc allocation containing @dev
  *
  * Since the allocation containing the struct &drm_device must be allocated
  * before it can be initialized with drm_dev_init() there's no way to allocate
@@ -129,12 +135,13 @@ static void add_dr(struct drm_device *dev, struct drmres *dr)
  * will be released in the final drm_dev_put() for @dev, after all other release
  * actions installed through drmm_add_action() have been processed.
  */
-void drmm_add_final_kfree(struct drm_device *dev, void *parent)
+void drmm_add_final_kfree(struct drm_device *dev, void *container)
 {
 	WARN_ON(dev->managed.final_kfree);
-	WARN_ON(dev < (struct drm_device *) parent);
-	WARN_ON(dev + 1 >= (struct drm_device *) (parent + ksize(parent)));
-	dev->managed.final_kfree = parent;
+	WARN_ON(dev < (struct drm_device *) container);
+	WARN_ON(dev + 1 >=
+		(struct drm_device *) (container + ksize(container)));
+	dev->managed.final_kfree = container;
 }
 EXPORT_SYMBOL(drmm_add_final_kfree);
 
@@ -154,7 +161,7 @@ int __drmm_add_action(struct drm_device *dev,
 		return -ENOMEM;
 	}
 
-	dr->node.name = name;
+	dr->node.name = kstrdup_const(name, GFP_KERNEL);
 	if (data) {
 		void_ptr = (void **)&dr->data;
 		*void_ptr = data;
@@ -212,7 +219,7 @@ void drmm_remove_action(struct drm_device *dev,
 	if (WARN_ON(!dr))
 		return;
 
-	kfree(dr);
+	free_dr(dr);
 }
 EXPORT_SYMBOL(drmm_remove_action);
 
@@ -300,6 +307,6 @@ void drmm_kfree(struct drm_device *dev, void *data)
 	if (WARN_ON(!dr_match))
 		return;
 
-	kfree(dr_match);
+	free_dr(dr_match);
 }
 EXPORT_SYMBOL(drmm_kfree);
diff --git a/include/drm/drm_managed.h b/include/drm/drm_managed.h
index af152cfb173c..e4021484c78d 100644
--- a/include/drm/drm_managed.h
+++ b/include/drm/drm_managed.h
@@ -51,7 +51,7 @@ void drmm_remove_action(struct drm_device *dev,
 			drmres_release_t action,
 			void *data);
 
-void drmm_add_final_kfree(struct drm_device *dev, void *parent);
+void drmm_add_final_kfree(struct drm_device *dev, void *container);
 
 void *drmm_kmalloc(struct drm_device *dev, size_t size, gfp_t gfp) __malloc;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
  2020-03-18 15:46 ` Sumit Semwal
@ 2020-03-18 16:53   ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2020-03-18 16:53 UTC (permalink / raw)
  To: Sumit Semwal
  Cc: Daniel Vetter, LKML, open list:DMA BUFFER SHARING FRAMEWORK,
	DRI mailing list, Linaro MM SIG, Joe Perches, Sam Ravnborg,
	Daniel Vetter

On Wed, Mar 18, 2020 at 09:16:17PM +0530, Sumit Semwal wrote:
> Hello Daniel,
> 
> Thanks for the patch.
> 
> On Wed, 18 Mar 2020 at 02:26, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >
> > We're getting some random other stuff that we're not really interested
> > in, so match only word boundaries. Also avoid the capture group while
> > at it.
> >
> > Suggested by Joe Perches.
> >
> > Cc: linux-media@vger.kernel.org
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: linaro-mm-sig@lists.linaro.org
> > Cc: Joe Perches <joe@perches.com>
> > Cc: Sumit Semwal <sumit.semwal@linaro.org>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> Acked-by: Sumit Semwal <sumit.semwal@linaro.org>

Thanks for your ack, patch applied.
-Daniel

> > ---
> > v2: No single quotes in MAINTAINERS (Joe)
> > v3: Fix typo in commit message (Sam)
> > ---
> >  MAINTAINERS | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 3005be638c2c..ed6088a01bfe 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -5025,7 +5025,7 @@ F:        include/linux/dma-buf*
> >  F:     include/linux/reservation.h
> >  F:     include/linux/*fence.h
> >  F:     Documentation/driver-api/dma-buf.rst
> > -K:     dma_(buf|fence|resv)
> > +K:     \bdma_(?:buf|fence|resv)\b
> >  T:     git git://anongit.freedesktop.org/drm/drm-misc
> >
> >  DMA-BUF HEAPS FRAMEWORK
> > --
> > 2.25.1
> >

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
  2020-03-17 20:56 Daniel Vetter
@ 2020-03-18 15:46 ` Sumit Semwal
  2020-03-18 16:53   ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Sumit Semwal @ 2020-03-18 15:46 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: LKML, open list:DMA BUFFER SHARING FRAMEWORK, DRI mailing list,
	Linaro MM SIG, Joe Perches, Sam Ravnborg, Daniel Vetter

Hello Daniel,

Thanks for the patch.

On Wed, 18 Mar 2020 at 02:26, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> We're getting some random other stuff that we're not really interested
> in, so match only word boundaries. Also avoid the capture group while
> at it.
>
> Suggested by Joe Perches.
>
> Cc: linux-media@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: Joe Perches <joe@perches.com>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
> ---
> v2: No single quotes in MAINTAINERS (Joe)
> v3: Fix typo in commit message (Sam)
> ---
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3005be638c2c..ed6088a01bfe 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5025,7 +5025,7 @@ F:        include/linux/dma-buf*
>  F:     include/linux/reservation.h
>  F:     include/linux/*fence.h
>  F:     Documentation/driver-api/dma-buf.rst
> -K:     dma_(buf|fence|resv)
> +K:     \bdma_(?:buf|fence|resv)\b
>  T:     git git://anongit.freedesktop.org/drm/drm-misc
>
>  DMA-BUF HEAPS FRAMEWORK
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
@ 2020-03-17 20:56 Daniel Vetter
  2020-03-18 15:46 ` Sumit Semwal
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2020-03-17 20:56 UTC (permalink / raw)
  To: LKML
  Cc: Daniel Vetter, linux-media, dri-devel, linaro-mm-sig,
	Joe Perches, Sumit Semwal, Sam Ravnborg, Daniel Vetter

We're getting some random other stuff that we're not really interested
in, so match only word boundaries. Also avoid the capture group while
at it.

Suggested by Joe Perches.

Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: Joe Perches <joe@perches.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
v2: No single quotes in MAINTAINERS (Joe)
v3: Fix typo in commit message (Sam)
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3005be638c2c..ed6088a01bfe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5025,7 +5025,7 @@ F:	include/linux/dma-buf*
 F:	include/linux/reservation.h
 F:	include/linux/*fence.h
 F:	Documentation/driver-api/dma-buf.rst
-K:	dma_(buf|fence|resv)
+K:	\bdma_(?:buf|fence|resv)\b
 T:	git git://anongit.freedesktop.org/drm/drm-misc
 
 DMA-BUF HEAPS FRAMEWORK
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
  2020-03-17  7:15 Daniel Vetter
  2020-03-17  8:17 ` Sam Ravnborg
@ 2020-03-17 12:49 ` Joe Perches
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Perches @ 2020-03-17 12:49 UTC (permalink / raw)
  To: Daniel Vetter, LKML
  Cc: linux-media, dri-devel, linaro-mm-sig, Sumit Semwal, Daniel Vetter

On Tue, 2020-03-17 at 08:15 +0100, Daniel Vetter wrote:
> We're getting some random other stuff that we're not relly interested
> in, so match only word boundaries. Also avoid the capture group while
> at it.
[]
> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -5025,7 +5025,7 @@ F:	include/linux/dma-buf*
>  F:	include/linux/reservation.h
>  F:	include/linux/*fence.h
>  F:	Documentation/driver-api/dma-buf.rst
> -K:	dma_(buf|fence|resv)
> +K:	'\bdma_(?:buf|fence|resv)\b'

You don't want the single quotes in the K: entry

K:	\bdma_(?:buf|fence|resv)\b

My mistake for adding them in the initial suggestion.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
  2020-03-17  7:15 Daniel Vetter
@ 2020-03-17  8:17 ` Sam Ravnborg
  2020-03-17 12:49 ` Joe Perches
  1 sibling, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2020-03-17  8:17 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: LKML, dri-devel, linaro-mm-sig, Joe Perches, Daniel Vetter, linux-media

Hi Daniel.

On Tue, Mar 17, 2020 at 08:15:47AM +0100, Daniel Vetter wrote:
> We're getting some random other stuff that we're not relly interested
                                                       really

> in, so match only word boundaries. Also avoid the capture group while
> at it.
> 
> Suggested by Joe Perches.

You want a:
Suggested-by: Joe Perches <joe@perches.com>

The patch looks correct, but I am not fluent in perlish.

	Sam
> 
> Cc: linux-media@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: Joe Perches <joe@perches.com>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3005be638c2c..fc5d5aa53147 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5025,7 +5025,7 @@ F:	include/linux/dma-buf*
>  F:	include/linux/reservation.h
>  F:	include/linux/*fence.h
>  F:	Documentation/driver-api/dma-buf.rst
> -K:	dma_(buf|fence|resv)
> +K:	'\bdma_(?:buf|fence|resv)\b'
>  T:	git git://anongit.freedesktop.org/drm/drm-misc
>  
>  DMA-BUF HEAPS FRAMEWORK
> -- 
> 2.25.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
@ 2020-03-17  7:15 Daniel Vetter
  2020-03-17  8:17 ` Sam Ravnborg
  2020-03-17 12:49 ` Joe Perches
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Vetter @ 2020-03-17  7:15 UTC (permalink / raw)
  To: LKML
  Cc: Daniel Vetter, linux-media, dri-devel, linaro-mm-sig,
	Joe Perches, Sumit Semwal, Daniel Vetter

We're getting some random other stuff that we're not relly interested
in, so match only word boundaries. Also avoid the capture group while
at it.

Suggested by Joe Perches.

Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: Joe Perches <joe@perches.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3005be638c2c..fc5d5aa53147 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5025,7 +5025,7 @@ F:	include/linux/dma-buf*
 F:	include/linux/reservation.h
 F:	include/linux/*fence.h
 F:	Documentation/driver-api/dma-buf.rst
-K:	dma_(buf|fence|resv)
+K:	'\bdma_(?:buf|fence|resv)\b'
 T:	git git://anongit.freedesktop.org/drm/drm-misc
 
 DMA-BUF HEAPS FRAMEWORK
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-18 16:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 17:06 [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2020-03-17 20:56 Daniel Vetter
2020-03-18 15:46 ` Sumit Semwal
2020-03-18 16:53   ` Daniel Vetter
2020-03-17  7:15 Daniel Vetter
2020-03-17  8:17 ` Sam Ravnborg
2020-03-17 12:49 ` Joe Perches

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).