Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: android: ion: Get rid of ion_phys_addr_t

Once upon a time, phys_addr_t was not everywhere in the kernel. These
days it is used enough places that having a separate Ion type doesn't
make sense. Remove the extra type and just use phys_addr_t directly.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Laura Abbott and committed by
Greg Kroah-Hartman
ddeb587b b0c7cb26

+12 -20
+2 -10
drivers/staging/android/ion/ion.h
··· 28 28 struct ion_client; 29 29 struct ion_buffer; 30 30 31 - /* 32 - * This should be removed some day when phys_addr_t's are fully 33 - * plumbed in the kernel, and all instances of ion_phys_addr_t should 34 - * be converted to phys_addr_t. For the time being many kernel interfaces 35 - * do not accept phys_addr_t's that would have to 36 - */ 37 - #define ion_phys_addr_t unsigned long 38 - 39 31 /** 40 32 * struct ion_platform_heap - defines a heap in the given platform 41 33 * @type: type of the heap from ion_heap_type enum ··· 45 53 enum ion_heap_type type; 46 54 unsigned int id; 47 55 const char *name; 48 - ion_phys_addr_t base; 56 + phys_addr_t base; 49 57 size_t size; 50 - ion_phys_addr_t align; 58 + phys_addr_t align; 51 59 void *priv; 52 60 }; 53 61
+5 -5
drivers/staging/android/ion/ion_carveout_heap.c
··· 30 30 struct ion_carveout_heap { 31 31 struct ion_heap heap; 32 32 struct gen_pool *pool; 33 - ion_phys_addr_t base; 33 + phys_addr_t base; 34 34 }; 35 35 36 - static ion_phys_addr_t ion_carveout_allocate(struct ion_heap *heap, 36 + static phys_addr_t ion_carveout_allocate(struct ion_heap *heap, 37 37 unsigned long size) 38 38 { 39 39 struct ion_carveout_heap *carveout_heap = ··· 46 46 return offset; 47 47 } 48 48 49 - static void ion_carveout_free(struct ion_heap *heap, ion_phys_addr_t addr, 49 + static void ion_carveout_free(struct ion_heap *heap, phys_addr_t addr, 50 50 unsigned long size) 51 51 { 52 52 struct ion_carveout_heap *carveout_heap = ··· 63 63 unsigned long flags) 64 64 { 65 65 struct sg_table *table; 66 - ion_phys_addr_t paddr; 66 + phys_addr_t paddr; 67 67 int ret; 68 68 69 69 table = kmalloc(sizeof(*table), GFP_KERNEL); ··· 96 96 struct ion_heap *heap = buffer->heap; 97 97 struct sg_table *table = buffer->sg_table; 98 98 struct page *page = sg_page(table->sgl); 99 - ion_phys_addr_t paddr = PFN_PHYS(page_to_pfn(page)); 99 + phys_addr_t paddr = PFN_PHYS(page_to_pfn(page)); 100 100 101 101 ion_heap_buffer_zero(buffer); 102 102
+3 -3
drivers/staging/android/ion/ion_chunk_heap.c
··· 27 27 struct ion_chunk_heap { 28 28 struct ion_heap heap; 29 29 struct gen_pool *pool; 30 - ion_phys_addr_t base; 30 + phys_addr_t base; 31 31 unsigned long chunk_size; 32 32 unsigned long size; 33 33 unsigned long allocated; ··· 151 151 chunk_heap->heap.ops = &chunk_heap_ops; 152 152 chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; 153 153 chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE; 154 - pr_debug("%s: base %lu size %zu \n", __func__, 155 - chunk_heap->base, heap_data->size); 154 + pr_debug("%s: base %pa size %zu \n", __func__, 155 + &chunk_heap->base, heap_data->size); 156 156 157 157 return &chunk_heap->heap; 158 158
+2 -2
drivers/staging/android/ion/ion_heap.c
··· 345 345 } 346 346 347 347 if (IS_ERR_OR_NULL(heap)) { 348 - pr_err("%s: error creating heap %s type %d base %lu size %zu\n", 348 + pr_err("%s: error creating heap %s type %d base %pa size %zu\n", 349 349 __func__, heap_data->name, heap_data->type, 350 - heap_data->base, heap_data->size); 350 + &heap_data->base, heap_data->size); 351 351 return ERR_PTR(-EINVAL); 352 352 } 353 353