aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-04-11 02:18:27 -0400
committerDave Airlie <airlied@linux.ie>2006-04-18 07:03:51 -0400
commit031de96af0e7ed6ad4a7ec2b74a77bf9782f966e (patch)
treec59cd37933c250b405ffe01b8decb274bc50d25a /drivers
parent31f64bd101ea256f9fc4a7f1f1706d6417d5550a (diff)
drivers/char/drm/drm_memory.c: possible cleanups
- #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> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/drm/drmP.h4
-rw-r--r--drivers/char/drm/drm_memory.c25
-rw-r--r--drivers/char/drm/drm_memory.h24
-rw-r--r--drivers/char/drm/drm_memory_debug.h2
4 files changed, 25 insertions, 30 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index edc72a6348a7..e1aadae00623 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -815,8 +815,6 @@ extern int drm_mem_info(char *buf, char **start, off_t offset,
815extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); 815extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
816extern void *drm_ioremap(unsigned long offset, unsigned long size, 816extern void *drm_ioremap(unsigned long offset, unsigned long size,
817 drm_device_t * dev); 817 drm_device_t * dev);
818extern void *drm_ioremap_nocache(unsigned long offset, unsigned long size,
819 drm_device_t * dev);
820extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t * dev); 818extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t * dev);
821 819
822extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type); 820extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type);
@@ -1022,11 +1020,13 @@ static __inline__ void drm_core_ioremap(struct drm_map *map,
1022 map->handle = drm_ioremap(map->offset, map->size, dev); 1020 map->handle = drm_ioremap(map->offset, map->size, dev);
1023} 1021}
1024 1022
1023#if 0
1025static __inline__ void drm_core_ioremap_nocache(struct drm_map *map, 1024static __inline__ void drm_core_ioremap_nocache(struct drm_map *map,
1026 struct drm_device *dev) 1025 struct drm_device *dev)
1027{ 1026{
1028 map->handle = drm_ioremap_nocache(map->offset, map->size, dev); 1027 map->handle = drm_ioremap_nocache(map->offset, map->size, dev);
1029} 1028}
1029#endif /* 0 */
1030 1030
1031static __inline__ void drm_core_ioremapfree(struct drm_map *map, 1031static __inline__ void drm_core_ioremapfree(struct drm_map *map,
1032 struct drm_device *dev) 1032 struct drm_device *dev)
diff --git a/drivers/char/drm/drm_memory.c b/drivers/char/drm/drm_memory.c
index 7ea00e3372fd..7e3318e1d1c6 100644
--- a/drivers/char/drm/drm_memory.c
+++ b/drivers/char/drm/drm_memory.c
@@ -83,8 +83,8 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area)
83/* 83/*
84 * Find the drm_map that covers the range [offset, offset+size). 84 * Find the drm_map that covers the range [offset, offset+size).
85 */ 85 */
86drm_map_t *drm_lookup_map(unsigned long offset, 86static drm_map_t *drm_lookup_map(unsigned long offset,
87 unsigned long size, drm_device_t * dev) 87 unsigned long size, drm_device_t * dev)
88{ 88{
89 struct list_head *list; 89 struct list_head *list;
90 drm_map_list_t *r_list; 90 drm_map_list_t *r_list;
@@ -102,8 +102,8 @@ drm_map_t *drm_lookup_map(unsigned long offset,
102 return NULL; 102 return NULL;
103} 103}
104 104
105void *agp_remap(unsigned long offset, unsigned long size, 105static void *agp_remap(unsigned long offset, unsigned long size,
106 drm_device_t * dev) 106 drm_device_t * dev)
107{ 107{
108 unsigned long *phys_addr_map, i, num_pages = 108 unsigned long *phys_addr_map, i, num_pages =
109 PAGE_ALIGN(size) / PAGE_SIZE; 109 PAGE_ALIGN(size) / PAGE_SIZE;
@@ -168,6 +168,21 @@ int drm_unbind_agp(DRM_AGP_MEM * handle)
168{ 168{
169 return drm_agp_unbind_memory(handle); 169 return drm_agp_unbind_memory(handle);
170} 170}
171
172#else /* __OS_HAS_AGP */
173
174static inline drm_map_t *drm_lookup_map(unsigned long offset,
175 unsigned long size, drm_device_t * dev)
176{
177 return NULL;
178}
179
180static inline void *agp_remap(unsigned long offset, unsigned long size,
181 drm_device_t * dev)
182{
183 return NULL;
184}
185
171#endif /* agp */ 186#endif /* agp */
172 187
173void *drm_ioremap(unsigned long offset, unsigned long size, 188void *drm_ioremap(unsigned long offset, unsigned long size,
@@ -183,6 +198,7 @@ void *drm_ioremap(unsigned long offset, unsigned long size,
183} 198}
184EXPORT_SYMBOL(drm_ioremap); 199EXPORT_SYMBOL(drm_ioremap);
185 200
201#if 0
186void *drm_ioremap_nocache(unsigned long offset, 202void *drm_ioremap_nocache(unsigned long offset,
187 unsigned long size, drm_device_t * dev) 203 unsigned long size, drm_device_t * dev)
188{ 204{
@@ -194,6 +210,7 @@ void *drm_ioremap_nocache(unsigned long offset,
194 } 210 }
195 return ioremap_nocache(offset, size); 211 return ioremap_nocache(offset, size);
196} 212}
213#endif /* 0 */
197 214
198void drm_ioremapfree(void *pt, unsigned long size, 215void drm_ioremapfree(void *pt, unsigned long size,
199 drm_device_t * dev) 216 drm_device_t * dev)
diff --git a/drivers/char/drm/drm_memory.h b/drivers/char/drm/drm_memory.h
index 645a08878e55..714d9aedcff5 100644
--- a/drivers/char/drm/drm_memory.h
+++ b/drivers/char/drm/drm_memory.h
@@ -57,15 +57,6 @@
57# endif 57# endif
58#endif 58#endif
59 59
60/*
61 * Find the drm_map that covers the range [offset, offset+size).
62 */
63drm_map_t *drm_lookup_map(unsigned long offset,
64 unsigned long size, drm_device_t * dev);
65
66void *agp_remap(unsigned long offset, unsigned long size,
67 drm_device_t * dev);
68
69static inline unsigned long drm_follow_page(void *vaddr) 60static inline unsigned long drm_follow_page(void *vaddr)
70{ 61{
71 pgd_t *pgd = pgd_offset_k((unsigned long)vaddr); 62 pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
@@ -77,18 +68,6 @@ static inline unsigned long drm_follow_page(void *vaddr)
77 68
78#else /* __OS_HAS_AGP */ 69#else /* __OS_HAS_AGP */
79 70
80static inline drm_map_t *drm_lookup_map(unsigned long offset,
81 unsigned long size, drm_device_t * dev)
82{
83 return NULL;
84}
85
86static inline void *agp_remap(unsigned long offset, unsigned long size,
87 drm_device_t * dev)
88{
89 return NULL;
90}
91
92static inline unsigned long drm_follow_page(void *vaddr) 71static inline unsigned long drm_follow_page(void *vaddr)
93{ 72{
94 return 0; 73 return 0;
@@ -99,8 +78,5 @@ static inline unsigned long drm_follow_page(void *vaddr)
99void *drm_ioremap(unsigned long offset, unsigned long size, 78void *drm_ioremap(unsigned long offset, unsigned long size,
100 drm_device_t * dev); 79 drm_device_t * dev);
101 80
102void *drm_ioremap_nocache(unsigned long offset,
103 unsigned long size, drm_device_t * dev);
104
105void drm_ioremapfree(void *pt, unsigned long size, 81void drm_ioremapfree(void *pt, unsigned long size,
106 drm_device_t * dev); 82 drm_device_t * dev);
diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h
index 7868341817da..6543b9a14c42 100644
--- a/drivers/char/drm/drm_memory_debug.h
+++ b/drivers/char/drm/drm_memory_debug.h
@@ -229,6 +229,7 @@ void *drm_ioremap (unsigned long offset, unsigned long size,
229 return pt; 229 return pt;
230} 230}
231 231
232#if 0
232void *drm_ioremap_nocache (unsigned long offset, unsigned long size, 233void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
233 drm_device_t * dev) { 234 drm_device_t * dev) {
234 void *pt; 235 void *pt;
@@ -251,6 +252,7 @@ void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
251 spin_unlock(&drm_mem_lock); 252 spin_unlock(&drm_mem_lock);
252 return pt; 253 return pt;
253} 254}
255#endif /* 0 */
254 256
255void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) { 257void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
256 int alloc_count; 258 int alloc_count;