From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>, airlied@linux.ie
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.sourceforge.ne
Subject: [-mm patch] drivers/char/drm/drm_memory.c: possible cleanups
Date: Sun, 9 Apr 2006 16:58:18 +0200 [thread overview]
Message-ID: <20060409145818.GD8454@stusta.de> (raw)
In-Reply-To: <20060408031405.5e5131da.akpm@osdl.org>
On Sat, Apr 08, 2006 at 03:14:05AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.17-rc1-mm1:
>...
> git-drm.patch
>...
> git trees
>...
This patch contains the following possible cleanups plus the changes
caused by them:
- #if 0 the following unused global function:
- drm_ioremap_nocache()
- make the following needlessly global functions static:
- agp_remap()
- drm_lookup_map()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/char/drm/drmP.h | 4 ++--
drivers/char/drm/drm_memory.c | 25 +++++++++++++++++++++----
drivers/char/drm/drm_memory.h | 24 ------------------------
drivers/char/drm/drm_memory_debug.h | 2 ++
4 files changed, 25 insertions(+), 30 deletions(-)
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drmP.h.old 2006-04-09 16:18:20.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drmP.h 2006-04-09 16:18:38.000000000 +0200
@@ -815,8 +815,6 @@
extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
extern void *drm_ioremap(unsigned long offset, unsigned long size,
drm_device_t * dev);
-extern void *drm_ioremap_nocache(unsigned long offset, unsigned long size,
- drm_device_t * dev);
extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t * dev);
extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type);
@@ -1022,11 +1020,13 @@
map->handle = drm_ioremap(map->offset, map->size, dev);
}
+#if 0
static __inline__ void drm_core_ioremap_nocache(struct drm_map *map,
struct drm_device *dev)
{
map->handle = drm_ioremap_nocache(map->offset, map->size, dev);
}
+#endif /* 0 */
static __inline__ void drm_core_ioremapfree(struct drm_map *map,
struct drm_device *dev)
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.h.old 2006-04-09 16:15:53.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.h 2006-04-09 16:21:28.000000000 +0200
@@ -57,15 +57,6 @@
# endif
#endif
-/*
- * Find the drm_map that covers the range [offset, offset+size).
- */
-drm_map_t *drm_lookup_map(unsigned long offset,
- unsigned long size, drm_device_t * dev);
-
-void *agp_remap(unsigned long offset, unsigned long size,
- drm_device_t * dev);
-
static inline unsigned long drm_follow_page(void *vaddr)
{
pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
@@ -77,18 +68,6 @@
#else /* __OS_HAS_AGP */
-static inline drm_map_t *drm_lookup_map(unsigned long offset,
- unsigned long size, drm_device_t * dev)
-{
- return NULL;
-}
-
-static inline void *agp_remap(unsigned long offset, unsigned long size,
- drm_device_t * dev)
-{
- return NULL;
-}
-
static inline unsigned long drm_follow_page(void *vaddr)
{
return 0;
@@ -99,8 +78,5 @@
void *drm_ioremap(unsigned long offset, unsigned long size,
drm_device_t * dev);
-void *drm_ioremap_nocache(unsigned long offset,
- unsigned long size, drm_device_t * dev);
-
void drm_ioremapfree(void *pt, unsigned long size,
drm_device_t * dev);
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory_debug.h.old 2006-04-09 16:19:31.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory_debug.h 2006-04-09 16:19:44.000000000 +0200
@@ -229,6 +229,7 @@
return pt;
}
+#if 0
void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
drm_device_t * dev) {
void *pt;
@@ -251,6 +252,7 @@
spin_unlock(&drm_mem_lock);
return pt;
}
+#endif /* 0 */
void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
int alloc_count;
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.c.old 2006-04-09 16:16:14.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.c 2006-04-09 16:21:24.000000000 +0200
@@ -83,8 +83,8 @@
/*
* Find the drm_map that covers the range [offset, offset+size).
*/
-drm_map_t *drm_lookup_map(unsigned long offset,
- unsigned long size, drm_device_t * dev)
+static drm_map_t *drm_lookup_map(unsigned long offset,
+ unsigned long size, drm_device_t * dev)
{
struct list_head *list;
drm_map_list_t *r_list;
@@ -102,8 +102,8 @@
return NULL;
}
-void *agp_remap(unsigned long offset, unsigned long size,
- drm_device_t * dev)
+static void *agp_remap(unsigned long offset, unsigned long size,
+ drm_device_t * dev)
{
unsigned long *phys_addr_map, i, num_pages =
PAGE_ALIGN(size) / PAGE_SIZE;
@@ -168,6 +168,21 @@
{
return drm_agp_unbind_memory(handle);
}
+
+#else /* __OS_HAS_AGP */
+
+static inline drm_map_t *drm_lookup_map(unsigned long offset,
+ unsigned long size, drm_device_t * dev)
+{
+ return NULL;
+}
+
+static inline void *agp_remap(unsigned long offset, unsigned long size,
+ drm_device_t * dev)
+{
+ return NULL;
+}
+
#endif /* agp */
void *drm_ioremap(unsigned long offset, unsigned long size,
@@ -183,6 +198,7 @@
}
EXPORT_SYMBOL(drm_ioremap);
+#if 0
void *drm_ioremap_nocache(unsigned long offset,
unsigned long size, drm_device_t * dev)
{
@@ -194,6 +210,7 @@
}
return ioremap_nocache(offset, size);
}
+#endif /* 0 */
void drm_ioremapfree(void *pt, unsigned long size,
drm_device_t * dev)
next prev parent reply other threads:[~2006-04-09 14:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-08 10:14 2.6.17-rc1-mm2 Andrew Morton
2006-04-09 11:31 ` [-mm patch] drivers/w1/w1.c: fix a compile error Adrian Bunk
2006-04-09 11:39 ` Evgeniy Polyakov
2006-04-09 14:50 ` [-mm patch] drivers/pci/hotplug/acpiphp_glue.c: make a function static Adrian Bunk
2006-04-10 0:27 ` MUNEDA Takahiro
2006-04-09 14:58 ` Adrian Bunk [this message]
2006-04-11 12:08 ` [PATCH] x86_64 sparsemem does not need node_mem_map Andy Whitcroft
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=20060409145818.GD8454@stusta.de \
--to=bunk@stusta.de \
--cc=airlied@linux.ie \
--cc=akpm@osdl.org \
--cc=dri-devel@lists.sourceforge.ne \
--cc=linux-kernel@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