@@ -1665,7 +1665,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask)
1665
1665
return vaddr ;
1666
1666
}
1667
1667
1668
- static void vb_free (const void * addr , unsigned long size )
1668
+ static void vb_free (unsigned long addr , unsigned long size )
1669
1669
{
1670
1670
unsigned long offset ;
1671
1671
unsigned long vb_idx ;
@@ -1675,24 +1675,22 @@ static void vb_free(const void *addr, unsigned long size)
1675
1675
BUG_ON (offset_in_page (size ));
1676
1676
BUG_ON (size > PAGE_SIZE * VMAP_MAX_ALLOC );
1677
1677
1678
- flush_cache_vunmap (( unsigned long ) addr , ( unsigned long ) addr + size );
1678
+ flush_cache_vunmap (addr , addr + size );
1679
1679
1680
1680
order = get_order (size );
1681
1681
1682
- offset = (unsigned long )addr & (VMAP_BLOCK_SIZE - 1 );
1683
- offset >>= PAGE_SHIFT ;
1682
+ offset = (addr & (VMAP_BLOCK_SIZE - 1 )) >> PAGE_SHIFT ;
1684
1683
1685
- vb_idx = addr_to_vb_idx (( unsigned long ) addr );
1684
+ vb_idx = addr_to_vb_idx (addr );
1686
1685
rcu_read_lock ();
1687
1686
vb = radix_tree_lookup (& vmap_block_tree , vb_idx );
1688
1687
rcu_read_unlock ();
1689
1688
BUG_ON (!vb );
1690
1689
1691
- vunmap_page_range (( unsigned long ) addr , ( unsigned long ) addr + size );
1690
+ vunmap_page_range (addr , addr + size );
1692
1691
1693
1692
if (debug_pagealloc_enabled_static ())
1694
- flush_tlb_kernel_range ((unsigned long )addr ,
1695
- (unsigned long )addr + size );
1693
+ flush_tlb_kernel_range (addr , addr + size );
1696
1694
1697
1695
spin_lock (& vb -> lock );
1698
1696
@@ -1792,7 +1790,7 @@ void vm_unmap_ram(const void *mem, unsigned int count)
1792
1790
1793
1791
if (likely (count <= VMAP_MAX_ALLOC )) {
1794
1792
debug_check_no_locks_freed (mem , size );
1795
- vb_free (mem , size );
1793
+ vb_free (addr , size );
1796
1794
return ;
1797
1795
}
1798
1796
0 commit comments