diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-06 15:27:09 +0300 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-06 15:27:09 +0300 |
| commit | 06059d5090118b047c5b6a621c8b57a068f7ce2c (patch) | |
| tree | 47431df1c04c02dfb7ecea479321142c56ad17cc /mm/cma_debug.c | |
| parent | 80aa93128653c5f2502053c0d9740b336d975667 (diff) | |
| parent | 8c10342cb48f3140d9abeadcfd2fa6625d447282 (diff) | |
| download | linux-06059d5090118b047c5b6a621c8b57a068f7ce2c.tar.xz | |
Merge tag 'topic/drm-misc-2015-07-28' into drm-intel-next-queued
We need a few core drm patches to be able to merge Maarten's series to
convert DPMS over to atomic.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'mm/cma_debug.c')
| -rw-r--r-- | mm/cma_debug.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mm/cma_debug.c b/mm/cma_debug.c index 7621ee34daa0..f8e4b60db167 100644 --- a/mm/cma_debug.c +++ b/mm/cma_debug.c @@ -39,7 +39,7 @@ static int cma_used_get(void *data, u64 *val) mutex_lock(&cma->lock); /* pages counter is smaller than sizeof(int) */ - used = bitmap_weight(cma->bitmap, (int)cma->count); + used = bitmap_weight(cma->bitmap, (int)cma_bitmap_maxno(cma)); mutex_unlock(&cma->lock); *val = (u64)used << cma->order_per_bit; @@ -52,13 +52,14 @@ static int cma_maxchunk_get(void *data, u64 *val) struct cma *cma = data; unsigned long maxchunk = 0; unsigned long start, end = 0; + unsigned long bitmap_maxno = cma_bitmap_maxno(cma); mutex_lock(&cma->lock); for (;;) { - start = find_next_zero_bit(cma->bitmap, cma->count, end); + start = find_next_zero_bit(cma->bitmap, bitmap_maxno, end); if (start >= cma->count) break; - end = find_next_bit(cma->bitmap, cma->count, start); + end = find_next_bit(cma->bitmap, bitmap_maxno, start); maxchunk = max(end - start, maxchunk); } mutex_unlock(&cma->lock); @@ -170,10 +171,10 @@ static void cma_debugfs_add_one(struct cma *cma, int idx) tmp = debugfs_create_dir(name, cma_debugfs_root); - debugfs_create_file("alloc", S_IWUSR, cma_debugfs_root, cma, + debugfs_create_file("alloc", S_IWUSR, tmp, cma, &cma_alloc_fops); - debugfs_create_file("free", S_IWUSR, cma_debugfs_root, cma, + debugfs_create_file("free", S_IWUSR, tmp, cma, &cma_free_fops); debugfs_create_file("base_pfn", S_IRUGO, tmp, |
