dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	Joe Perches <joe@perches.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-media@vger.kernel.org
Subject: [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv
Date: Tue, 17 Mar 2020 18:06:02 +0100	[thread overview]
Message-ID: <20200317170602.1021982-1-daniel.vetter@ffwll.ch> (raw)

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

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

             reply	other threads:[~2020-03-17 17:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 17:06 Daniel Vetter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-03-17 20:56 [PATCH] MAINTAINERS: Better regex for dma_buf|fence|resv 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

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=20200317170602.1021982-1-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joe@perches.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /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).