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>
This commit is contained in:
parent
31f64bd101
commit
031de96af0
@ -815,8 +815,6 @@ extern int drm_mem_info(char *buf, char **start, off_t offset,
|
|||||||
extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
|
extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
|
||||||
extern void *drm_ioremap(unsigned long offset, unsigned long size,
|
extern void *drm_ioremap(unsigned long offset, unsigned long size,
|
||||||
drm_device_t * dev);
|
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 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);
|
extern 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,
|
|||||||
map->handle = drm_ioremap(map->offset, map->size, dev);
|
map->handle = drm_ioremap(map->offset, map->size, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static __inline__ void drm_core_ioremap_nocache(struct drm_map *map,
|
static __inline__ void drm_core_ioremap_nocache(struct drm_map *map,
|
||||||
struct drm_device *dev)
|
struct drm_device *dev)
|
||||||
{
|
{
|
||||||
map->handle = drm_ioremap_nocache(map->offset, map->size, dev);
|
map->handle = drm_ioremap_nocache(map->offset, map->size, dev);
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
|
|
||||||
static __inline__ void drm_core_ioremapfree(struct drm_map *map,
|
static __inline__ void drm_core_ioremapfree(struct drm_map *map,
|
||||||
struct drm_device *dev)
|
struct drm_device *dev)
|
||||||
|
@ -83,8 +83,8 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area)
|
|||||||
/*
|
/*
|
||||||
* Find the drm_map that covers the range [offset, offset+size).
|
* Find the drm_map that covers the range [offset, offset+size).
|
||||||
*/
|
*/
|
||||||
drm_map_t *drm_lookup_map(unsigned long offset,
|
static drm_map_t *drm_lookup_map(unsigned long offset,
|
||||||
unsigned long size, drm_device_t * dev)
|
unsigned long size, drm_device_t * dev)
|
||||||
{
|
{
|
||||||
struct list_head *list;
|
struct list_head *list;
|
||||||
drm_map_list_t *r_list;
|
drm_map_list_t *r_list;
|
||||||
@ -102,8 +102,8 @@ drm_map_t *drm_lookup_map(unsigned long offset,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *agp_remap(unsigned long offset, unsigned long size,
|
static void *agp_remap(unsigned long offset, unsigned long size,
|
||||||
drm_device_t * dev)
|
drm_device_t * dev)
|
||||||
{
|
{
|
||||||
unsigned long *phys_addr_map, i, num_pages =
|
unsigned long *phys_addr_map, i, num_pages =
|
||||||
PAGE_ALIGN(size) / PAGE_SIZE;
|
PAGE_ALIGN(size) / PAGE_SIZE;
|
||||||
@ -168,6 +168,21 @@ int drm_unbind_agp(DRM_AGP_MEM * handle)
|
|||||||
{
|
{
|
||||||
return drm_agp_unbind_memory(handle);
|
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 */
|
#endif /* agp */
|
||||||
|
|
||||||
void *drm_ioremap(unsigned long offset, unsigned long size,
|
void *drm_ioremap(unsigned long offset, unsigned long size,
|
||||||
@ -183,6 +198,7 @@ void *drm_ioremap(unsigned long offset, unsigned long size,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_ioremap);
|
EXPORT_SYMBOL(drm_ioremap);
|
||||||
|
|
||||||
|
#if 0
|
||||||
void *drm_ioremap_nocache(unsigned long offset,
|
void *drm_ioremap_nocache(unsigned long offset,
|
||||||
unsigned long size, drm_device_t * dev)
|
unsigned long size, drm_device_t * dev)
|
||||||
{
|
{
|
||||||
@ -194,6 +210,7 @@ void *drm_ioremap_nocache(unsigned long offset,
|
|||||||
}
|
}
|
||||||
return ioremap_nocache(offset, size);
|
return ioremap_nocache(offset, size);
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
|
|
||||||
void drm_ioremapfree(void *pt, unsigned long size,
|
void drm_ioremapfree(void *pt, unsigned long size,
|
||||||
drm_device_t * dev)
|
drm_device_t * dev)
|
||||||
|
@ -57,15 +57,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#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)
|
static inline unsigned long drm_follow_page(void *vaddr)
|
||||||
{
|
{
|
||||||
pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
|
pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
|
||||||
@ -77,18 +68,6 @@ static inline unsigned long drm_follow_page(void *vaddr)
|
|||||||
|
|
||||||
#else /* __OS_HAS_AGP */
|
#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)
|
static inline unsigned long drm_follow_page(void *vaddr)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@ -99,8 +78,5 @@ static inline unsigned long drm_follow_page(void *vaddr)
|
|||||||
void *drm_ioremap(unsigned long offset, unsigned long size,
|
void *drm_ioremap(unsigned long offset, unsigned long size,
|
||||||
drm_device_t * dev);
|
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,
|
void drm_ioremapfree(void *pt, unsigned long size,
|
||||||
drm_device_t * dev);
|
drm_device_t * dev);
|
||||||
|
@ -229,6 +229,7 @@ void *drm_ioremap (unsigned long offset, unsigned long size,
|
|||||||
return pt;
|
return pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
|
void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
|
||||||
drm_device_t * dev) {
|
drm_device_t * dev) {
|
||||||
void *pt;
|
void *pt;
|
||||||
@ -251,6 +252,7 @@ void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
|
|||||||
spin_unlock(&drm_mem_lock);
|
spin_unlock(&drm_mem_lock);
|
||||||
return pt;
|
return pt;
|
||||||
}
|
}
|
||||||
|
#endif /* 0 */
|
||||||
|
|
||||||
void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
|
void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
|
||||||
int alloc_count;
|
int alloc_count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user