aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_proc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-05-25 15:01:51 -0400
committerDave Airlie <airlied@linux.ie>2007-07-10 21:58:02 -0400
commitbd1b331fae2813d9f03ceee649296f02edc0b893 (patch)
tree6139f72ebae88c332c754745f3d98cbe794ae4de /drivers/char/drm/drm_proc.c
parent4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff)
drm: cleanup use of Linux list handling macros
This makes the drms use of the list handling macros a lot cleaner and more along the lines of how they should be used and uses them in some more places. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_proc.c')
-rw-r--r--drivers/char/drm/drm_proc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c
index b204498d1a28..1b1735ab3fbf 100644
--- a/drivers/char/drm/drm_proc.c
+++ b/drivers/char/drm/drm_proc.c
@@ -209,7 +209,6 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
209 int len = 0; 209 int len = 0;
210 drm_map_t *map; 210 drm_map_t *map;
211 drm_map_list_t *r_list; 211 drm_map_list_t *r_list;
212 struct list_head *list;
213 212
214 /* Hardcoded from _DRM_FRAME_BUFFER, 213 /* Hardcoded from _DRM_FRAME_BUFFER,
215 _DRM_REGISTERS, _DRM_SHM, _DRM_AGP, and 214 _DRM_REGISTERS, _DRM_SHM, _DRM_AGP, and
@@ -229,9 +228,7 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
229 DRM_PROC_PRINT("slot offset size type flags " 228 DRM_PROC_PRINT("slot offset size type flags "
230 "address mtrr\n\n"); 229 "address mtrr\n\n");
231 i = 0; 230 i = 0;
232 if (dev->maplist != NULL) 231 list_for_each_entry(r_list, &dev->maplist, head) {
233 list_for_each(list, &dev->maplist->head) {
234 r_list = list_entry(list, drm_map_list_t, head);
235 map = r_list->map; 232 map = r_list->map;
236 if (!map) 233 if (!map)
237 continue; 234 continue;
@@ -242,14 +239,15 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
242 DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08x ", 239 DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08x ",
243 i, 240 i,
244 map->offset, 241 map->offset,
245 map->size, type, map->flags, r_list->user_token); 242 map->size, type, map->flags,
243 r_list->user_token);
246 if (map->mtrr < 0) { 244 if (map->mtrr < 0) {
247 DRM_PROC_PRINT("none\n"); 245 DRM_PROC_PRINT("none\n");
248 } else { 246 } else {
249 DRM_PROC_PRINT("%4d\n", map->mtrr); 247 DRM_PROC_PRINT("%4d\n", map->mtrr);
250 } 248 }
251 i++; 249 i++;
252 } 250 }
253 251
254 if (len > request + offset) 252 if (len > request + offset)
255 return request; 253 return request;
@@ -444,7 +442,7 @@ static int drm__clients_info(char *buf, char **start, off_t offset,
444 *eof = 0; 442 *eof = 0;
445 443
446 DRM_PROC_PRINT("a dev pid uid magic ioctls\n\n"); 444 DRM_PROC_PRINT("a dev pid uid magic ioctls\n\n");
447 for (priv = dev->file_first; priv; priv = priv->next) { 445 list_for_each_entry(priv, &dev->filelist, lhead) {
448 DRM_PROC_PRINT("%c %3d %5d %5d %10u %10lu\n", 446 DRM_PROC_PRINT("%c %3d %5d %5d %10u %10lu\n",
449 priv->authenticated ? 'y' : 'n', 447 priv->authenticated ? 'y' : 'n',
450 priv->minor, 448 priv->minor,
@@ -497,7 +495,7 @@ static int drm__vma_info(char *buf, char **start, off_t offset, int request,
497 DRM_PROC_PRINT("vma use count: %d, high_memory = %p, 0x%08lx\n", 495 DRM_PROC_PRINT("vma use count: %d, high_memory = %p, 0x%08lx\n",
498 atomic_read(&dev->vma_count), 496 atomic_read(&dev->vma_count),
499 high_memory, virt_to_phys(high_memory)); 497 high_memory, virt_to_phys(high_memory));
500 for (pt = dev->vmalist; pt; pt = pt->next) { 498 list_for_each_entry(pt, &dev->vmalist, head) {
501 if (!(vma = pt->vma)) 499 if (!(vma = pt->vma))
502 continue; 500 continue;
503 DRM_PROC_PRINT("\n%5d 0x%08lx-0x%08lx %c%c%c%c%c%c 0x%08lx000", 501 DRM_PROC_PRINT("\n%5d 0x%08lx-0x%08lx %c%c%c%c%c%c 0x%08lx000",