mm: fix boundary checking in free_bootmem_core
[sfrench/cifs-2.6.git] / mm / highmem.c
index 7a967bc351526d8f745fb2f3a9655a5151ed783f..7da4a7b6af11f1d359af60568b312838f8fa2802 100644 (file)
@@ -104,8 +104,9 @@ static void flush_all_zero_pkmaps(void)
        flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP));
 }
 
-/* Flush all unused kmap mappings in order to remove stray
-   mappings. */
+/**
+ * kmap_flush_unused - flush all unused kmap mappings in order to remove stray mappings
+ */
 void kmap_flush_unused(void)
 {
        spin_lock(&kmap_lock);
@@ -163,15 +164,21 @@ start:
        return vaddr;
 }
 
-void fastcall *kmap_high(struct page *page)
+/**
+ * kmap_high - map a highmem page into memory
+ * @page: &struct page to map
+ *
+ * Returns the page's virtual memory address.
+ *
+ * We cannot call this from interrupts, as it may block.
+ */
+void *kmap_high(struct page *page)
 {
        unsigned long vaddr;
 
        /*
         * For highmem pages, we can't trust "virtual" until
         * after we have the lock.
-        *
-        * We cannot call this from interrupts, as it may block
         */
        spin_lock(&kmap_lock);
        vaddr = (unsigned long)page_address(page);
@@ -185,7 +192,11 @@ void fastcall *kmap_high(struct page *page)
 
 EXPORT_SYMBOL(kmap_high);
 
-void fastcall kunmap_high(struct page *page)
+/**
+ * kunmap_high - map a highmem page into memory
+ * @page: &struct page to unmap
+ */
+void kunmap_high(struct page *page)
 {
        unsigned long vaddr;
        unsigned long nr;
@@ -259,6 +270,12 @@ static struct page_address_slot *page_slot(struct page *page)
        return &page_address_htable[hash_ptr(page, PA_HASH_ORDER)];
 }
 
+/**
+ * page_address - get the mapped virtual address of a page
+ * @page: &struct page to get the virtual address of
+ *
+ * Returns the page's virtual address.
+ */
 void *page_address(struct page *page)
 {
        unsigned long flags;
@@ -288,6 +305,11 @@ done:
 
 EXPORT_SYMBOL(page_address);
 
+/**
+ * set_page_address - set a page's virtual address
+ * @page: &struct page to set
+ * @virtual: virtual address to use
+ */
 void set_page_address(struct page *page, void *virtual)
 {
        unsigned long flags;