mm/page_alloc.c: remove unnecessary end_bitidx for [set|get]_pfnblock_flags_mask()
[linux-2.6-microblaze.git] / mm / memory.c
index 3ecad55..c39a13b 100644 (file)
@@ -437,7 +437,7 @@ int __pte_alloc(struct mm_struct *mm, pmd_t *pmd)
         * of a chain of data-dependent loads, meaning most CPUs (alpha
         * being the notable exception) will already guarantee loads are
         * seen in-order. See the alpha page table accessors for the
-        * smp_read_barrier_depends() barriers in page table walking code.
+        * smp_rmb() barriers in page table walking code.
         */
        smp_wmb(); /* Could be smp_wmb__xxx(before|after)_spin_lock */
 
@@ -1098,7 +1098,7 @@ again:
                }
 
                entry = pte_to_swp_entry(ptent);
-               if (non_swap_entry(entry) && is_device_private_entry(entry)) {
+               if (is_device_private_entry(entry)) {
                        struct page *page = device_private_entry_to_page(entry);
 
                        if (unlikely(details && details->check_mapping)) {
@@ -2082,7 +2082,7 @@ static inline int remap_p4d_range(struct mm_struct *mm, pgd_t *pgd,
 /**
  * remap_pfn_range - remap kernel memory to userspace
  * @vma: user vma to map to
- * @addr: target user address to start at
+ * @addr: target page aligned user address to start at
  * @pfn: page frame number of kernel physical memory address
  * @size: size of mapping area
  * @prot: page protection flags for this mapping
@@ -2101,6 +2101,9 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
        unsigned long remap_pfn = pfn;
        int err;
 
+       if (WARN_ON_ONCE(!PAGE_ALIGNED(addr)))
+               return -EINVAL;
+
        /*
         * Physically remapped pages are special. Tell the
         * rest of the world about it:
@@ -2205,7 +2208,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
 {
        pte_t *pte;
        int err = 0;
-       spinlock_t *uninitialized_var(ptl);
+       spinlock_t *ptl;
 
        if (create) {
                pte = (mm == &init_mm) ?