]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'akpm/master'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 05:24:01 +0000 (16:24 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 05:24:01 +0000 (16:24 +1100)
77 files changed:
Documentation/DMA-API.txt
Documentation/sysctl/vm.txt
arch/arm/include/asm/highmem.h
arch/arm/mm/highmem.c
arch/frv/include/asm/highmem.h
arch/frv/mm/highmem.c
arch/metag/include/asm/highmem.h
arch/metag/mm/highmem.c
arch/microblaze/include/asm/highmem.h
arch/mips/include/asm/highmem.h
arch/mips/include/uapi/asm/unistd.h
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/mm/highmem.c
arch/parisc/include/asm/cacheflush.h
arch/powerpc/include/asm/highmem.h
arch/sparc/include/uapi/asm/unistd.h
arch/sparc/kernel/systbls_32.S
arch/sparc/kernel/systbls_64.S
arch/tile/include/asm/highmem.h
arch/tile/mm/highmem.c
arch/x86/include/asm/highmem.h
arch/x86/mm/highmem_32.c
drivers/gpu/drm/nouveau/nouveau_ttm.c
drivers/gpu/drm/tegra/sor.c
drivers/input/joystick/walkera0701.c
drivers/media/i2c/ov9650.c
drivers/media/pci/cx23885/cx23885-core.c
drivers/media/pci/cx25821/cx25821-core.c
drivers/media/pci/cx88/cx88-alsa.c
drivers/media/pci/cx88/cx88-mpeg.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/netup_unidvb/netup_unidvb_core.c
drivers/media/pci/saa7134/saa7134-core.c
drivers/media/pci/saa7164/saa7164-core.c
drivers/media/pci/tw68/tw68-core.c
drivers/net/ethernet/amd/pcnet32.c
drivers/net/ethernet/sfc/efx.c
drivers/net/usb/kaweth.c
drivers/net/usb/usbnet.c
drivers/net/wireless/mac80211_hwsim.c
drivers/parisc/ccio-dma.c
drivers/scsi/cxgbi/cxgb3i/Kbuild
drivers/scsi/cxgbi/cxgb4i/Kbuild
drivers/thermal/power_allocator.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/fotg210-hcd.c
drivers/usb/host/oxu210hp-hcd.c
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/binfmt_elf_fdpic.c
fs/btrfs/inode.c
fs/exofs/namei.c
fs/ext2/namei.c
fs/ext4/mballoc.c
fs/f2fs/namei.c
fs/gfs2/lock_dlm.c
fs/hpfs/namei.c
fs/jfs/namei.c
fs/jfs/super.c
fs/ncpfs/dir.c
fs/nilfs2/namei.c
fs/reiserfs/namei.c
fs/stat.c
fs/ubifs/dir.c
fs/ubifs/misc.h
include/asm-generic/pci-dma-compat.h
include/linux/highmem.h
include/linux/kdev_t.h
include/linux/kernel.h
kernel/time/clocksource.c
kernel/time/timekeeping.c
lib/div64.c
net/ipv4/route.c
net/sctp/transport.c

index 8d065d6ec956b5b5db47400fb4f72d2f8fad390e..1e98a7e6bccc44ecab915f0abb1431aa717edf93 100644 (file)
@@ -141,19 +141,6 @@ memory back to the pool before you destroy it.
 Part Ic - DMA addressing limitations
 ------------------------------------
 
-int
-dma_supported(struct device *dev, u64 mask)
-
-Checks to see if the device can support DMA to the memory described by
-mask.
-
-Returns: 1 if it can and 0 if it can't.
-
-Notes: This routine merely tests to see if the mask is possible.  It
-won't change the current mask settings.  It is more intended as an
-internal API for use by the platform than an external API for use by
-driver writers.
-
 int
 dma_set_mask_and_coherent(struct device *dev, u64 mask)
 
index a4482fceacecc9443f6cdc12b5083acdeabbcca1..f72370b440b121e718183ea6a7dbb9bafc2dcc25 100644 (file)
@@ -639,7 +639,7 @@ and don't use much of it.
 The default value is 0.
 
 See Documentation/vm/overcommit-accounting and
-security/commoncap.c::cap_vm_enough_memory() for more information.
+mm/mmap.c::__vm_enough_memory() for more information.
 
 ==============================================================
 
index 535579511ed035f50d14bc179b4c00b74a0b4f95..0a0e2d1784c011ddf917312f51931cefb8fa5d8a 100644 (file)
@@ -68,7 +68,6 @@ extern void kunmap(struct page *page);
 extern void *kmap_atomic(struct page *page);
 extern void __kunmap_atomic(void *kvaddr);
 extern void *kmap_atomic_pfn(unsigned long pfn);
-extern struct page *kmap_atomic_to_page(const void *ptr);
 #endif
 
 #endif
index 9df5f09585ca49bc48c209f8588a395ca5f8d449..d02f8187b1ccedb0df0520d2d75e6d93c838b360 100644 (file)
@@ -147,13 +147,3 @@ void *kmap_atomic_pfn(unsigned long pfn)
 
        return (void *)vaddr;
 }
-
-struct page *kmap_atomic_to_page(const void *ptr)
-{
-       unsigned long vaddr = (unsigned long)ptr;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       return pte_page(get_fixmap_pte(vaddr));
-}
index b3adc93611f32c51ae10716e0decfa8e40ac8b9d..1f58938703ab6e73d824b68d5000c25e347248d4 100644 (file)
@@ -62,8 +62,6 @@ extern void kunmap_high(struct page *page);
 extern void *kmap(struct page *page);
 extern void kunmap(struct page *page);
 
-extern struct page *kmap_atomic_to_page(void *ptr);
-
 #endif /* !__ASSEMBLY__ */
 
 /*
index 785344bbdc07c360e81768c8472336bebd0baa3e..45750fb65c4927f9c59b5b5b0d6b4755e33475d0 100644 (file)
@@ -32,11 +32,6 @@ void kunmap(struct page *page)
 
 EXPORT_SYMBOL(kunmap);
 
-struct page *kmap_atomic_to_page(void *ptr)
-{
-       return virt_to_page(ptr);
-}
-
 void *kmap_atomic(struct page *page)
 {
        unsigned long paddr;
index 6646a15c73dd70c55dbb999d422c84234d6d6e15..9b1d172cd884ad822627bf0f4dab12cddab47674 100644 (file)
@@ -56,7 +56,6 @@ extern void kunmap(struct page *page);
 extern void *kmap_atomic(struct page *page);
 extern void __kunmap_atomic(void *kvaddr);
 extern void *kmap_atomic_pfn(unsigned long pfn);
-extern struct page *kmap_atomic_to_page(void *ptr);
 #endif
 
 #endif
index 807f1b1c4e6567738f676c935ad21483e4972a32..f19a87f2c1ec3401cbe3290bedc4146c5b716646 100644 (file)
@@ -111,20 +111,6 @@ void *kmap_atomic_pfn(unsigned long pfn)
        return (void *)vaddr;
 }
 
-struct page *kmap_atomic_to_page(void *ptr)
-{
-       unsigned long vaddr = (unsigned long)ptr;
-       int idx;
-       pte_t *pte;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       idx = virt_to_fix(vaddr);
-       pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
-       return pte_page(*pte);
-}
-
 void __init kmap_init(void)
 {
        unsigned long kmap_vstart;
index d0463893243888f47bf1e740d7ebf0e68fb087c4..67925ef18cfa3ce0c433b8da11727be67d1d32d1 100644 (file)
@@ -76,19 +76,6 @@ static inline void *kmap_atomic(struct page *page)
        return kmap_atomic_prot(page, kmap_prot);
 }
 
-static inline struct page *kmap_atomic_to_page(void *ptr)
-{
-       unsigned long idx, vaddr = (unsigned long) ptr;
-       pte_t *pte;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       idx = virt_to_fix(vaddr);
-       pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
-       return pte_page(*pte);
-}
-
 #define flush_cache_kmaps()    { flush_icache(); flush_dcache(); }
 
 #endif /* __KERNEL__ */
index 572e63ec2a38fe8f40faa2555ee7595d8be82cce..01880b34a209b37dd5b02d759afda543f7989e9a 100644 (file)
@@ -49,7 +49,6 @@ extern void kunmap(struct page *page);
 extern void *kmap_atomic(struct page *page);
 extern void __kunmap_atomic(void *kvaddr);
 extern void *kmap_atomic_pfn(unsigned long pfn);
-extern struct page *kmap_atomic_to_page(void *ptr);
 
 #define flush_cache_kmaps()    flush_cache_all()
 
index cfabadb135d9fe94912080ea41ca761e6f1eca08..90f03a7da6654da7000108042dcf00944d322406 100644 (file)
 #define __NR_execveat                  (__NR_Linux + 356)
 #define __NR_userfaultfd               (__NR_Linux + 357)
 #define __NR_membarrier                        (__NR_Linux + 358)
+#define __NR_mlock2                    (__NR_Linux + 359)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux_syscalls            358
+#define __NR_Linux_syscalls            359
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #define __NR_O32_Linux                 4000
-#define __NR_O32_Linux_syscalls                358
+#define __NR_O32_Linux_syscalls                359
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 
 #define __NR_execveat                  (__NR_Linux + 316)
 #define __NR_userfaultfd               (__NR_Linux + 317)
 #define __NR_membarrier                        (__NR_Linux + 318)
+#define __NR_mlock2                    (__NR_Linux + 319)
 
 /*
  * Offset of the last Linux 64-bit flavoured syscall
  */
-#define __NR_Linux_syscalls            318
+#define __NR_Linux_syscalls            319
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux                  5000
-#define __NR_64_Linux_syscalls         318
+#define __NR_64_Linux_syscalls         319
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
 #define __NR_execveat                  (__NR_Linux + 320)
 #define __NR_userfaultfd               (__NR_Linux + 321)
 #define __NR_membarrier                        (__NR_Linux + 322)
+#define __NR_mlock2                    (__NR_Linux + 323)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls            322
+#define __NR_Linux_syscalls            323
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                322
+#define __NR_N32_Linux_syscalls                323
 
 #endif /* _UAPI_ASM_UNISTD_H */
index 65a74e4f0f456d1de9d29ed83a62e1bcc6e644fc..2d23c834ba96cd328a87d016e328176fc9a6876e 100644 (file)
@@ -594,3 +594,4 @@ EXPORT(sys_call_table)
        PTR     sys_execveat
        PTR     sys_userfaultfd
        PTR     sys_membarrier
+       PTR     sys_mlock2
index e732981cf99fde26181f1db3bcb65ebd86ea4a0d..deac63315d0ed4123d1e0f09b617e9250d68c885 100644 (file)
@@ -432,4 +432,5 @@ EXPORT(sys_call_table)
        PTR     sys_execveat
        PTR     sys_userfaultfd
        PTR     sys_membarrier
+       PTR     sys_mlock2
        .size   sys_call_table,.-sys_call_table
index c794843975845df2e0a9d9c0c0fd14dad1ed17ec..5a69eb48d0a8cef87c33c3184f4ddc3236f01d2d 100644 (file)
@@ -422,4 +422,5 @@ EXPORT(sysn32_call_table)
        PTR     compat_sys_execveat             /* 6320 */
        PTR     sys_userfaultfd
        PTR     sys_membarrier
+       PTR     sys_mlock2
        .size   sysn32_call_table,.-sysn32_call_table
index 6369cfd390c6330269b05eb095020dafa6cdc048..e4b6d7c9782263e7c6dfca1b7eb4e6818ca78a6e 100644 (file)
@@ -577,4 +577,5 @@ EXPORT(sys32_call_table)
        PTR     compat_sys_execveat
        PTR     sys_userfaultfd
        PTR     sys_membarrier
+       PTR     sys_mlock2
        .size   sys32_call_table,.-sys32_call_table
index 11661cbc11a8193f7a9817fb0101fd9483db9f23..d7258a103439d8316b527d64569955339489fe4c 100644 (file)
@@ -118,19 +118,6 @@ void *kmap_atomic_pfn(unsigned long pfn)
        return (void*) vaddr;
 }
 
-struct page *kmap_atomic_to_page(void *ptr)
-{
-       unsigned long idx, vaddr = (unsigned long)ptr;
-       pte_t *pte;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       idx = virt_to_fix(vaddr);
-       pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
-       return pte_page(*pte);
-}
-
 void __init kmap_init(void)
 {
        unsigned long kmap_vstart;
index ec2df4bab3022dfc35a83539afcd24207e199f9f..845272ce9cc587222e835131bb5ed96be0be03d4 100644 (file)
@@ -156,7 +156,6 @@ static inline void __kunmap_atomic(void *addr)
 
 #define kmap_atomic_prot(page, prot)   kmap_atomic(page)
 #define kmap_atomic_pfn(pfn)   kmap_atomic(pfn_to_page(pfn))
-#define kmap_atomic_to_page(ptr)       virt_to_page(ptr)
 
 #endif /* _PARISC_CACHEFLUSH_H */
 
index caaf6e00630d0d74b2966b1bce89a367ad3ceaa6..01c2c23b307e76b7a3df003c5ac8c599f11baa5c 100644 (file)
@@ -84,19 +84,6 @@ static inline void *kmap_atomic(struct page *page)
        return kmap_atomic_prot(page, kmap_prot);
 }
 
-static inline struct page *kmap_atomic_to_page(void *ptr)
-{
-       unsigned long idx, vaddr = (unsigned long) ptr;
-       pte_t *pte;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       idx = virt_to_fix(vaddr);
-       pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
-       return pte_page(*pte);
-}
-
 
 #define flush_cache_kmaps()    flush_cache_all()
 
index 6f35f4df17f281f5aa52c31381a6b781629bbbb0..efe9479f837bb50d289106cd22128292dd19ef5f 100644 (file)
 #define __NR_memfd_create      348
 #define __NR_bpf               349
 #define __NR_execveat          350
+#define __NR_membarrier                351
 
-#define NR_syscalls            351
+#define NR_syscalls            352
 
 /* Bitmask values returned from kern_features system call.  */
 #define KERN_FEATURE_MIXED_MODE_STACK  0x00000001
index e31a9056a3039ad5e5b2b7da5abe7f18509d1107..cc23b62b6e38a858c7e077c6b2c0757a63803b3d 100644 (file)
@@ -87,4 +87,4 @@ sys_call_table:
 /*335*/        .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
 /*340*/        .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
 /*345*/        .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
-/*350*/        .long sys_execveat
+/*350*/        .long sys_execveat, sys_membarrier
index d72f76ae70eba5a7418630c7e1890a6e239675cd..f229468a747975ea7eb0dac89886747efb52f773 100644 (file)
@@ -88,7 +88,7 @@ sys_call_table32:
        .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
 /*340*/        .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
        .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
-/*350*/        .word sys32_execveat
+/*350*/        .word sys32_execveat, sys_membarrier
 
 #endif /* CONFIG_COMPAT */
 
@@ -168,4 +168,4 @@ sys_call_table:
        .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
 /*340*/        .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
        .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
-/*350*/        .word sys64_execveat
+/*350*/        .word sys64_execveat, sys_membarrier
index fc8429a31c850b561f6bb47df86b4dfa5731edfc..979579b38e573a03a6153bd160abc1a2d3959713 100644 (file)
@@ -63,7 +63,6 @@ void *kmap_atomic(struct page *page);
 void __kunmap_atomic(void *kvaddr);
 void *kmap_atomic_pfn(unsigned long pfn);
 void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
-struct page *kmap_atomic_to_page(void *ptr);
 void *kmap_atomic_prot(struct page *page, pgprot_t prot);
 void kmap_atomic_fix_kpte(struct page *page, int finished);
 
index fcd545014e79dcc83a662f4db5a37e7511e695a0..eca28551b22d418d0252145e79d8565125a246d5 100644 (file)
@@ -275,15 +275,3 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
 {
        return kmap_atomic_prot(pfn_to_page(pfn), prot);
 }
-
-struct page *kmap_atomic_to_page(void *ptr)
-{
-       pte_t *pte;
-       unsigned long vaddr = (unsigned long)ptr;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       pte = kmap_get_pte(vaddr);
-       return pte_page(*pte);
-}
index 04e9d023168f9d098d6f6d90a2c4b8cbae4dc209..1c0b43724ce33adb755ad2655d1c9be555e7afea 100644 (file)
@@ -68,7 +68,6 @@ void *kmap_atomic(struct page *page);
 void __kunmap_atomic(void *kvaddr);
 void *kmap_atomic_pfn(unsigned long pfn);
 void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
-struct page *kmap_atomic_to_page(void *ptr);
 
 #define flush_cache_kmaps()    do { } while (0)
 
index eecb207a2037080f9f5d74c36c300b217a4f7a82..a6d7392581379ba0de7c51b85193ea33d20546c9 100644 (file)
@@ -104,20 +104,6 @@ void __kunmap_atomic(void *kvaddr)
 }
 EXPORT_SYMBOL(__kunmap_atomic);
 
-struct page *kmap_atomic_to_page(void *ptr)
-{
-       unsigned long idx, vaddr = (unsigned long)ptr;
-       pte_t *pte;
-
-       if (vaddr < FIXADDR_START)
-               return virt_to_page(ptr);
-
-       idx = virt_to_fix(vaddr);
-       pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
-       return pte_page(*pte);
-}
-EXPORT_SYMBOL(kmap_atomic_to_page);
-
 void __init set_highmem_pages_init(void)
 {
        struct zone *zone;
index 3f713c1b5dc112a42f58555a19c39ef73bbf67a5..d2e7d209f6517450165c33b7485f94102f887e6d 100644 (file)
@@ -353,8 +353,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
 
        bits = nvxx_mmu(&drm->device)->dma_bits;
        if (nvxx_device(&drm->device)->func->pci) {
-               if (drm->agp.bridge ||
-                    !dma_supported(dev->dev, DMA_BIT_MASK(bits)))
+               if (drm->agp.bridge)
                        bits = 32;
        } else if (device->func->tegra) {
                struct nvkm_device_tegra *tegra = device->func->tegra(device);
@@ -369,6 +368,10 @@ nouveau_ttm_init(struct nouveau_drm *drm)
        }
 
        ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
+       if (ret && bits != 32) {
+               bits = 32;
+               ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
+       }
        if (ret)
                return ret;
 
index da1715ebdd7118c698621e574764b0054aeb125b..3eff7cf75d2555a08c0f54dee0aa76cec42f6b3d 100644 (file)
@@ -555,11 +555,11 @@ static int tegra_sor_compute_params(struct tegra_sor *sor,
        error = div_s64(active_sym - approx, tu_size);
        error *= params->num_clocks;
 
-       if (error <= 0 && abs64(error) < params->error) {
+       if (error <= 0 && abs(error) < params->error) {
                params->active_count = div_u64(active_count, f);
                params->active_polarity = active_polarity;
                params->active_frac = active_frac;
-               params->error = abs64(error);
+               params->error = abs(error);
                params->tu_size = tu_size;
 
                if (error == 0)
index d88f5dd3c9d9e9a7080cbd9bacecb740e0791488..9c07fe911075f3e1dba089f07d7d60d10ac327ba 100644 (file)
@@ -150,7 +150,7 @@ static void walkera0701_irq_handler(void *handler_data)
                if (w->counter == 24) { /* full frame */
                        walkera0701_parse_frame(w);
                        w->counter = NO_SYNC;
-                       if (abs64(pulse_time - SYNC_PULSE) < RESERVE)   /* new frame sync */
+                       if (abs(pulse_time - SYNC_PULSE) < RESERVE)     /* new frame sync */
                                w->counter = 0;
                } else {
                        if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE)
@@ -161,7 +161,7 @@ static void walkera0701_irq_handler(void *handler_data)
                        } else
                                w->counter = NO_SYNC;
                }
-       } else if (abs64(pulse_time - SYNC_PULSE - BIN0_PULSE) <
+       } else if (abs(pulse_time - SYNC_PULSE - BIN0_PULSE) <
                                RESERVE + BIN1_PULSE - BIN0_PULSE)      /* frame sync .. */
                w->counter = 0;
 
index e691bba1945b7a77c2078bf9ee577cbffa9ade7d..1ee6a5527c384676333587115a18565ba76f0519 100644 (file)
@@ -1133,7 +1133,7 @@ static int __ov965x_set_frame_interval(struct ov965x *ov965x,
                if (mbus_fmt->width != iv->size.width ||
                    mbus_fmt->height != iv->size.height)
                        continue;
-               err = abs64((u64)(iv->interval.numerator * 10000) /
+               err = abs((u64)(iv->interval.numerator * 10000) /
                            iv->interval.denominator - req_int);
                if (err < min_err) {
                        fiv = iv;
index bc1c9602f4352a33ddb1797e616bfe212f89d5ad..35759a91d47dce2eaede0d0491910aeb0180cab7 100644 (file)
@@ -1992,7 +1992,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
                (unsigned long long)pci_resource_start(pci_dev, 0));
 
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev, 0xffffffff)) {
+       if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
                printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
                err = -EIO;
                goto fail_context;
index 559f8293c53a2703327d9c05e798e221800b5bd8..dbc695f327607285162a6f6482582f5fe1857ff8 100644 (file)
@@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
                dev->pci_lat, (unsigned long long)dev->base_io_addr);
 
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev, 0xffffffff)) {
+       if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
                pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
                err = -EIO;
                goto fail_irq;
index 57ddf8a34178dcb5c9884c9bff61b4c9a1cf5a90..0ed1b65303746d3b5129997dc37dd00cbe784716 100644 (file)
@@ -890,7 +890,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
                return err;
        }
 
-       if (!pci_dma_supported(pci,DMA_BIT_MASK(32))) {
+       if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
                dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
                err = -EIO;
                cx88_core_put(core, pci);
index 9961b2232b97fd42eaef0e2fffa16de06cad99d1..9db7767d1fe03eaad3244993d193f1045cb5f92b 100644 (file)
@@ -393,7 +393,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
        if (pci_enable_device(dev->pci))
                return -EIO;
        pci_set_master(dev->pci);
-       if (!pci_dma_supported(dev->pci,DMA_BIT_MASK(32))) {
+       if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
                printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
                return -EIO;
        }
index f3b12dbbe9a18bfd605251a46d01cb163fec2dfa..0de1ad5a977d4d7b629819bb2d0ee0fb54539bb3 100644 (file)
@@ -1314,7 +1314,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
               dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
 
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev,DMA_BIT_MASK(32))) {
+       if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
                printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
                err = -EIO;
                goto fail_core;
index 83c90d3462e9b4384c1bb25d8621a65c556e092e..60b2d462f98d0ea92a3738d45919dce57c3c9daf 100644 (file)
@@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
                "%s(): board vendor 0x%x, revision 0x%x\n",
                __func__, board_vendor, board_revision);
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev, 0xffffffff)) {
+       if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
                dev_err(&pci_dev->dev,
                        "%s(): 32bit PCI DMA is not supported\n", __func__);
                goto pci_detect_err;
index 87f39f97a79f21ab8dc016754cc8a19d0d2677de..e79d63eb774e338898584ee33fa8476b0cb5b2cf 100644 (file)
@@ -951,7 +951,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
               pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
               dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev, DMA_BIT_MASK(32))) {
+       if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
                pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
                err = -EIO;
                goto fail1;
index 3206a826b80d274e74df51c476a1b50074132c35..8f36b48ef7338c13ae265f9d424e05348d389f6f 100644 (file)
@@ -1264,7 +1264,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
 
        pci_set_master(pci_dev);
        /* TODO */
-       if (!pci_dma_supported(pci_dev, 0xffffffff)) {
+       if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
                printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
                err = -EIO;
                goto fail_irq;
index 04706cc9b8189830a024c037a77241965381f1b2..8c5655d351d35c4d1b82ca8f84390c32f31b0306 100644 (file)
@@ -257,7 +257,7 @@ static int tw68_initdev(struct pci_dev *pci_dev,
                dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
                dev->pci_lat, (u64)pci_resource_start(pci_dev, 0));
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev, DMA_BIT_MASK(32))) {
+       if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
                pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
                err = -EIO;
                goto fail1;
index bc8b04f4288286d0bf253417b08c7fa6fe1e59ca..e2afabf3a465860230cbae73d8e37166d30c5394 100644 (file)
@@ -1500,7 +1500,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
-       if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) {
+       if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
                if (pcnet32_debug & NETIF_MSG_PROBE)
                        pr_err("architecture does not support 32bit PCI busmaster DMA\n");
                return -ENODEV;
index 6e11ee6173ce566e97a61ad99e929cfc49895d84..d288f1c928de611455e44b515972b172340e4686 100644 (file)
@@ -1247,11 +1247,9 @@ static int efx_init_io(struct efx_nic *efx)
         * masks event though they reject 46 bit masks.
         */
        while (dma_mask > 0x7fffffffUL) {
-               if (dma_supported(&pci_dev->dev, dma_mask)) {
-                       rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
-                       if (rc == 0)
-                               break;
-               }
+               rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
+               if (rc == 0)
+                       break;
                dma_mask >>= 1;
        }
        if (rc) {
index 1e9cdca370144cffb22141e4c03aa3ff800aefdd..f64b25c221e83b63704db0d856132ca96b7e606c 100644 (file)
@@ -1177,12 +1177,6 @@ err_fw:
        INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
        usb_set_intfdata(intf, kaweth);
 
-#if 0
-// dma_supported() is deeply broken on almost all architectures
-       if (dma_supported (dev, 0xffffffffffffffffULL))
-               kaweth->net->features |= NETIF_F_HIGHDMA;
-#endif
-
        SET_NETDEV_DEV(netdev, dev);
        if (register_netdev(netdev) != 0) {
                dev_err(dev, "Error registering netdev.\n");
index 060918f49fea82779a37d326a4d1729189ddad28..0744bf2ef2d6e42044c6c31f7c74b0ec120e07d3 100644 (file)
@@ -1662,12 +1662,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
         * bind() should set rx_urb_size in that case.
         */
        dev->hard_mtu = net->mtu + net->hard_header_len;
-#if 0
-// dma_supported() is deeply broken on almost all architectures
-       // possible with some EHCI controllers
-       if (dma_supported (&udev->dev, DMA_BIT_MASK(64)))
-               net->features |= NETIF_F_HIGHDMA;
-#endif
 
        net->netdev_ops = &usbnet_netdev_ops;
        net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
index ee46f4647fbc4803d629047462b4f696fcfea2f6..c00a7daaa4bc7be08c290cb2f159fb2e3a0ff19c 100644 (file)
@@ -787,7 +787,7 @@ static void mac80211_hwsim_set_tsf(struct ieee80211_hw *hw,
        struct mac80211_hwsim_data *data = hw->priv;
        u64 now = mac80211_hwsim_get_tsf(hw, vif);
        u32 bcn_int = data->beacon_int;
-       u64 delta = abs64(tsf - now);
+       u64 delta = abs(tsf - now);
 
        /* adjust after beaconing with new timestamp at old TBTT */
        if (tsf > now) {
index 957b42198328f74809cf944ef33a023cb5745b41..8e11fb2831cd20cb9e4b95415aee05041bb7813b 100644 (file)
@@ -704,8 +704,6 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
  * ccio_dma_supported - Verify the IOMMU supports the DMA address range.
  * @dev: The PCI device.
  * @mask: A bit mask describing the DMA address range of the device.
- *
- * This function implements the pci_dma_supported function.
  */
 static int 
 ccio_dma_supported(struct device *dev, u64 mask)
index 6f095e28a9747c0428e121df204d42d5edc66f60..961a12f6d318858e73aa3375e6d4c20bbac176fc 100644 (file)
@@ -1,3 +1,3 @@
-EXTRA_CFLAGS += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb3
+ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb3
 
 obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o
index 8290cdaa4652a156300b6ae04b7f23f12bc67576..37458643749bca1f1e082b28eac209e0dfe68966 100644 (file)
@@ -1,3 +1,3 @@
-EXTRA_CFLAGS += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb4
+ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb4
 
 obj-$(CONFIG_SCSI_CXGB4_ISCSI) += cxgb4i.o
index e570ff084add5b0596cbac05d07bca560d350b01..f0fbea386869a66d9ab60fdcc7f74d7e0179b095 100644 (file)
@@ -228,7 +228,7 @@ static u32 pid_controller(struct thermal_zone_device *tz,
        if (err < int_to_frac(tz->tzp->integral_cutoff)) {
                s64 i_next = i + mul_frac(tz->tzp->k_i, err);
 
-               if (abs64(i_next) < max_power_frac) {
+               if (abs(i_next) < max_power_frac) {
                        i = i_next;
                        params->err_integral += err;
                }
index c63d82c91f105d9ad83d54c90cfca84b455bc2d6..48c92bf78bd065ecc21bdda8ee5f50f426f25fda 100644 (file)
@@ -589,7 +589,7 @@ static int ehci_run (struct usb_hcd *hcd)
         * streaming mappings for I/O buffers, like pci_map_single(),
         * can return segments above 4GB, if the device allows.
         *
-        * NOTE:  the dma mask is visible through dma_supported(), so
+        * NOTE:  the dma mask is visible through dev->dma_mask, so
         * drivers can pass this info along ... like NETIF_F_HIGHDMA,
         * Scsi_Host.highmem_io, and so forth.  It's readonly to all
         * host side drivers though.
index 787f4e3d16d81989dd71e9061d25992f789e000d..2341af4f34909bd81ce53e4364a34eeaf54dfa03 100644 (file)
@@ -5063,7 +5063,7 @@ static int fotg210_run(struct usb_hcd *hcd)
         * streaming mappings for I/O buffers, like pci_map_single(),
         * can return segments above 4GB, if the device allows.
         *
-        * NOTE:  the dma mask is visible through dma_supported(), so
+        * NOTE:  the dma mask is visible through dev->dma_mask, so
         * drivers can pass this info along ... like NETIF_F_HIGHDMA,
         * Scsi_Host.highmem_io, and so forth.  It's readonly to all
         * host side drivers though.
index fe3bd1cb8b6bd9dcd82071fb9c98a0ae66fc1836..1f139d82cee08a92ccd0698201882d4be5d9d97c 100644 (file)
@@ -2721,7 +2721,7 @@ static int oxu_run(struct usb_hcd *hcd)
         * streaming mappings for I/O buffers, like pci_map_single(),
         * can return segments above 4GB, if the device allows.
         *
-        * NOTE:  the dma mask is visible through dma_supported(), so
+        * NOTE:  the dma mask is visible through dev->dma_mask, so
         * drivers can pass this info along ... like NETIF_F_HIGHDMA,
         * Scsi_Host.highmem_io, and so forth.  It's readonly to all
         * host side drivers though.
index b1dc5188804831af2d58478b700b424e5d78d895..699941e906672b87eb1b5199f7966e29528e0116 100644 (file)
@@ -1368,9 +1368,6 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rde
                 dir->i_ino, dentry, mode,
                 MAJOR(rdev), MINOR(rdev));
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        /* build extension */
        if (S_ISBLK(mode))
                sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev));
index e8aa57dc8d6dff5a7a46899d2ba94a4ec0b715b1..cb899af1babc3bf42b48a6064d7f9345ae0bb4a8 100644 (file)
@@ -829,9 +829,6 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
                 dir->i_ino, dentry, omode,
                 MAJOR(rdev), MINOR(rdev));
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        v9ses = v9fs_inode2v9ses(dir);
        dir_dentry = dentry->d_parent;
        dfid = v9fs_fid_lookup(dir_dentry);
index d2b079afed0e627e817d061c8861da4bcb4755df..50d15b7b0ca9f11953209bff7e03b8fb40358a57 100644 (file)
@@ -103,19 +103,36 @@ static void __exit exit_elf_fdpic_binfmt(void)
 core_initcall(init_elf_fdpic_binfmt);
 module_exit(exit_elf_fdpic_binfmt);
 
-static int is_elf_fdpic(struct elfhdr *hdr, struct file *file)
+static int is_elf(struct elfhdr *hdr, struct file *file)
 {
        if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0)
                return 0;
        if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN)
                return 0;
-       if (!elf_check_arch(hdr) || !elf_check_fdpic(hdr))
+       if (!elf_check_arch(hdr))
                return 0;
        if (!file->f_op->mmap)
                return 0;
        return 1;
 }
 
+#ifndef elf_check_fdpic
+#define elf_check_fdpic(x) 0
+#endif
+
+#ifndef elf_check_const_displacement
+#define elf_check_const_displacement(x) 0
+#endif
+
+static int is_constdisp(struct elfhdr *hdr)
+{
+       if (!elf_check_fdpic(hdr))
+               return 1;
+       if (elf_check_const_displacement(hdr))
+               return 1;
+       return 0;
+}
+
 /*****************************************************************************/
 /*
  * read the program headers table into memory
@@ -191,8 +208,18 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
 
        /* check that this is a binary we know how to deal with */
        retval = -ENOEXEC;
-       if (!is_elf_fdpic(&exec_params.hdr, bprm->file))
+       if (!is_elf(&exec_params.hdr, bprm->file))
                goto error;
+       if (!elf_check_fdpic(&exec_params.hdr)) {
+#ifdef CONFIG_MMU
+               /* binfmt_elf handles non-fdpic elf except on nommu */
+               goto error;
+#else
+               /* nommu can only load ET_DYN (PIE) ELF */
+               if (exec_params.hdr.e_type != ET_DYN)
+                       goto error;
+#endif
+       }
 
        /* read the program header table */
        retval = elf_fdpic_fetch_phdrs(&exec_params, bprm->file);
@@ -269,13 +296,13 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
 
        }
 
-       if (elf_check_const_displacement(&exec_params.hdr))
+       if (is_constdisp(&exec_params.hdr))
                exec_params.flags |= ELF_FDPIC_FLAG_CONSTDISP;
 
        /* perform insanity checks on the interpreter */
        if (interpreter_name) {
                retval = -ELIBBAD;
-               if (!is_elf_fdpic(&interp_params.hdr, interpreter))
+               if (!is_elf(&interp_params.hdr, interpreter))
                        goto error;
 
                interp_params.flags = ELF_FDPIC_FLAG_PRESENT;
@@ -306,9 +333,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
 
        retval = -ENOEXEC;
        if (stack_size == 0)
-               goto error;
+               stack_size = 131072UL; /* same as exec.c's default commit */
 
-       if (elf_check_const_displacement(&interp_params.hdr))
+       if (is_constdisp(&interp_params.hdr))
                interp_params.flags |= ELF_FDPIC_FLAG_CONSTDISP;
 
        /* flush all traces of the currently running executable */
@@ -319,7 +346,10 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
        /* there's now no turning back... the old userspace image is dead,
         * defunct, deceased, etc.
         */
-       set_personality(PER_LINUX_FDPIC);
+       if (elf_check_fdpic(&exec_params.hdr))
+               set_personality(PER_LINUX_FDPIC);
+       else
+               set_personality(PER_LINUX);
        if (elf_read_implies_exec(&exec_params.hdr, executable_stack))
                current->personality |= READ_IMPLIES_EXEC;
 
index 611b66d73e80ba0e5f97b4415595d20f8ae35e1a..0946790ff9ca88576049e0d18c89c0106b169555 100644 (file)
@@ -6268,9 +6268,6 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
        u64 objectid;
        u64 index = 0;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        /*
         * 2 for inode item and ref
         * 2 for dir items
index 09a6bb1ad63c840b91ef56114871753454046292..994e078da4bb746fd8c088f70efbfaa19a4665a3 100644 (file)
@@ -80,9 +80,6 @@ static int exofs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
        struct inode *inode;
        int err;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        inode = exofs_new_inode(dir, mode);
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
index b4841e3066a5bb15c153c84ab4bc808ee2f2cbc9..3267a80dbbe26f4fbefb14c82fdb832d9169d6a8 100644 (file)
@@ -143,9 +143,6 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode,
        struct inode * inode;
        int err;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        err = dquot_initialize(dir);
        if (err)
                return err;
index 1e97ac1dd4bb78756f5c93de22ee47b4b88bc49d..b4da7f2a5db2d353b811c2c17e64ff7735ed6a1c 100644 (file)
@@ -3332,8 +3332,8 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block,
                atomic_inc(&pa->pa_count);
                return pa;
        }
-       cur_distance = abs64(goal_block - cpa->pa_pstart);
-       new_distance = abs64(goal_block - pa->pa_pstart);
+       cur_distance = abs(goal_block - cpa->pa_pstart);
+       new_distance = abs(goal_block - pa->pa_pstart);
 
        if (cur_distance <= new_distance)
                return cpa;
index e48b80c490905ac500958b9f7b0a74de38dc8463..2c32110f9fc082408b318cac2142602ab7888a9e 100644 (file)
@@ -481,9 +481,6 @@ static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
        struct inode *inode;
        int err = 0;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        f2fs_balance_fs(sbi);
 
        inode = f2fs_new_inode(dir, mode);
index 284c1542783eb03dcdec9c1d5b5b91e92754ea12..8b907c5cc9135caad82506f921c1f0b56bb1acda 100644 (file)
@@ -50,7 +50,7 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
        s64 delta = sample - s->stats[index];
        s->stats[index] += (delta >> 3);
        index++;
-       s->stats[index] += ((abs64(delta) - s->stats[index]) >> 2);
+       s->stats[index] += ((abs(delta) - s->stats[index]) >> 2);
 }
 
 /**
index 9e92c9c2d31954cbd178b5e218e79d5db7c43f8f..ae4d5a1fa4c9b7f75ce188d8ec80e69d0a820892 100644 (file)
@@ -227,8 +227,6 @@ static int hpfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, de
        int err;
        if ((err = hpfs_chk_name(name, &len))) return err==-ENOENT ? -EINVAL : err;
        if (hpfs_sb(dir->i_sb)->sb_eas < 2) return -EPERM;
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
        hpfs_lock(dir->i_sb);
        err = -ENOSPC;
        fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh);
index 35976bdccafcf3419abf6bbf7a870c75864fc405..9d7551f5c32a9ffb9a166f588e5f2211d62d0249 100644 (file)
@@ -1372,9 +1372,6 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
        tid_t tid;
        struct tblock *tblk;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        jfs_info("jfs_mknod: %pd", dentry);
 
        rc = dquot_initialize(dir);
index 4cd9798f4948c646d065c50dd0f6092fe75197b0..8f9176caf098c559bbe3c9975b2dff9fffb0ffb4 100644 (file)
@@ -496,9 +496,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 
        jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags);
 
-       if (!new_valid_dev(sb->s_bdev->bd_dev))
-               return -EOVERFLOW;
-
        sbi = kzalloc(sizeof(struct jfs_sb_info), GFP_KERNEL);
        if (!sbi)
                return -ENOMEM;
index 356816e7bc90d2d2de4a4fc0e25b10ad42b839dc..f0e3e9e747dd72aaa756611cb0c881d19b902d5a 100644 (file)
@@ -1165,8 +1165,6 @@ out:
 static int ncp_mknod(struct inode * dir, struct dentry *dentry,
                     umode_t mode, dev_t rdev)
 {
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
        if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) {
                ncp_dbg(1, "mode = 0%ho\n", mode);
                return ncp_create_new(dir, dentry, mode, rdev, 0);
index 37dd6b05b1b5bfe2b794123f3fac1eb5260e91ea..c9a1a491aa9124b4cad5941e477f7ac3ae5de8b1 100644 (file)
@@ -120,9 +120,6 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev)
        struct nilfs_transaction_info ti;
        int err;
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        err = nilfs_transaction_begin(dir->i_sb, &ti, 1);
        if (err)
                return err;
index 5f1c9c29eb8c9196053f3e626e9084b1f93aae18..47f96988fdd478dbc6ce325232d38754258864cc 100644 (file)
@@ -712,9 +712,6 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode
            2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) +
                 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb));
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        retval = dquot_initialize(dir);
        if (retval)
                return retval;
index cccc1aab9a8b75231f056a18b0b9fc3ecaaf1561..d4a61d8dc021e6e70a3a1317ef793753de8165ed 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -367,8 +367,6 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
        INIT_STRUCT_STAT64_PADDING(tmp);
 #ifdef CONFIG_MIPS
        /* mips has weird padding, so we don't get 64 bits there */
-       if (!new_valid_dev(stat->dev) || !new_valid_dev(stat->rdev))
-               return -EOVERFLOW;
        tmp.st_dev = new_encode_dev(stat->dev);
        tmp.st_rdev = new_encode_dev(stat->rdev);
 #else
index 5c27c66c224af38618ec4f92b453bd8e65d24608..1dd9267c165bade5e2e0d7de25ff95d4cb99586e 100644 (file)
@@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
 
        dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        if (S_ISBLK(mode) || S_ISCHR(mode)) {
                dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
                if (!dev)
index ee7cb5ebb6e8910f851469bce4dcb205785cb85c..8ece6ca58c0ba128f658ea0c42ddc7976d942314 100644 (file)
@@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
  */
 static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
 {
-       if (new_valid_dev(rdev)) {
-               dev->new = cpu_to_le32(new_encode_dev(rdev));
-               return sizeof(dev->new);
-       } else {
-               dev->huge = cpu_to_le64(huge_encode_dev(rdev));
-               return sizeof(dev->huge);
-       }
+       dev->new = cpu_to_le32(new_encode_dev(rdev));
+       return sizeof(dev->new);
 }
 
 /**
index c110843fc53b3f80174496148df8798c866db1b5..eafce7b6f052384c549a1c10f20f09b5356a6f04 100644 (file)
@@ -6,12 +6,6 @@
 
 #include <linux/dma-mapping.h>
 
-static inline int
-pci_dma_supported(struct pci_dev *hwdev, u64 mask)
-{
-       return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask);
-}
-
 static inline void *
 pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
                     dma_addr_t *dma_handle)
index 6aefcd0031a6bd013cf322d1021812fcf84250c2..bb3f3297062a0b67a590adbb6630d6f419249ea5 100644 (file)
@@ -78,7 +78,6 @@ static inline void __kunmap_atomic(void *addr)
 }
 
 #define kmap_atomic_pfn(pfn)   kmap_atomic(pfn_to_page(pfn))
-#define kmap_atomic_to_page(ptr)       virt_to_page(ptr)
 
 #define kmap_flush_unused()    do {} while(0)
 #endif
index c838abe3ee0a80dfccfb2bfbf1bc1e5067fa9dca..052c7b32cc91d3ebd051d3018739227e303967b1 100644 (file)
@@ -20,7 +20,7 @@
        })
 
 /* acceptable for old filesystems */
-static inline int old_valid_dev(dev_t dev)
+static inline bool old_valid_dev(dev_t dev)
 {
        return MAJOR(dev) < 256 && MINOR(dev) < 256;
 }
@@ -35,7 +35,7 @@ static inline dev_t old_decode_dev(u16 val)
        return MKDEV((val >> 8) & 255, val & 255);
 }
 
-static inline int new_valid_dev(dev_t dev)
+static inline bool new_valid_dev(dev_t dev)
 {
        return 1;
 }
@@ -54,11 +54,6 @@ static inline dev_t new_decode_dev(u32 dev)
        return MKDEV(major, minor);
 }
 
-static inline int huge_valid_dev(dev_t dev)
-{
-       return 1;
-}
-
 static inline u64 huge_encode_dev(dev_t dev)
 {
        return new_encode_dev(dev);
index 2c13f747ac2e8727b090f26f085f8cc79972c6b3..350dfb08aee36bdce54c8ecf683dd7afed7b46ab 100644 (file)
@@ -200,28 +200,28 @@ extern int _cond_resched(void);
 
 #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
 
-/*
- * abs() handles unsigned and signed longs, ints, shorts and chars.  For all
- * input types abs() returns a signed long.
- * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()
- * for those.
+/**
+ * abs - return absolute value of an argument
+ * @x: the value.  If it is unsigned type, it is converted to signed type first
+ *   (s64, long or int depending on its size).
+ *
+ * Return: an absolute value of x.  If x is 64-bit, macro's return type is s64,
+ *   otherwise it is signed long.
  */
-#define abs(x) ({                                              \
-               long ret;                                       \
-               if (sizeof(x) == sizeof(long)) {                \
-                       long __x = (x);                         \
-                       ret = (__x < 0) ? -__x : __x;           \
-               } else {                                        \
-                       int __x = (x);                          \
-                       ret = (__x < 0) ? -__x : __x;           \
-               }                                               \
-               ret;                                            \
-       })
-
-#define abs64(x) ({                            \
-               s64 __x = (x);                  \
-               (__x < 0) ? -__x : __x;         \
-       })
+#define abs(x) __builtin_choose_expr(sizeof(x) == sizeof(s64), ({      \
+               s64 __x = (x);                                          \
+               (__x < 0) ? -__x : __x;                                 \
+       }), ({                                                          \
+               long ret;                                               \
+               if (sizeof(x) == sizeof(long)) {                        \
+                       long __x = (x);                                 \
+                       ret = (__x < 0) ? -__x : __x;                   \
+               } else {                                                \
+                       int __x = (x);                                  \
+                       ret = (__x < 0) ? -__x : __x;                   \
+               }                                                       \
+               ret;                                                    \
+       }))
 
 /**
  * reciprocal_scale - "scale" a value into range [0, ep_ro)
index 0d8fe8b8f72772e0899662c29011d1d22c261c8f..1347882d131e11a404b029d83edfb281483b9c9c 100644 (file)
@@ -217,7 +217,7 @@ static void clocksource_watchdog(unsigned long data)
                        continue;
 
                /* Check the deviation from the watchdog clocksource. */
-               if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
+               if (abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
                        pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n",
                                cs->name);
                        pr_warn("                      '%s' wd_now: %llx wd_last: %llx mask: %llx\n",
index b1356b7ae57057139acf46c2c68cfa27688bcb63..d563c19603029bc6c57ac55154f71ed027320276 100644 (file)
@@ -1614,7 +1614,7 @@ static __always_inline void timekeeping_freqadjust(struct timekeeper *tk,
        negative = (tick_error < 0);
 
        /* Sort out the magnitude of the correction */
-       tick_error = abs64(tick_error);
+       tick_error = abs(tick_error);
        for (adj = 0; tick_error > interval; adj++)
                tick_error >>= 1;
 
index 19ea7ed4b948297ae8f03367d3484840ec4456f6..62a698a432bc6f618cd7b3ae1938b24e2215a93f 100644 (file)
@@ -162,7 +162,7 @@ s64 div64_s64(s64 dividend, s64 divisor)
 {
        s64 quot, t;
 
-       quot = div64_u64(abs64(dividend), abs64(divisor));
+       quot = div64_u64(abs(dividend), abs(divisor));
        t = (dividend ^ divisor) >> 63;
 
        return (quot ^ t) - t;
index 85f184e429c63c8c426f58c779dc3544cf2e2a54..da11b54563fdd2ef697d9668bad2e5b6ea99f376 100644 (file)
@@ -1740,6 +1740,8 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
        struct net    *net = dev_net(dev);
        bool do_cache;
 
+       res.table = 0;
+
        /* IP on this device is disabled. */
 
        if (!in_dev)
index a0a431824f63a731728bd36279dc76b86cc2471b..aab9e3f29755a58eb7584aa763b4b1a46d2e6608 100644 (file)
@@ -331,7 +331,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
                 * 1/8, rto_alpha would be expressed as 3.
                 */
                tp->rttvar = tp->rttvar - (tp->rttvar >> net->sctp.rto_beta)
-                       + (((__u32)abs64((__s64)tp->srtt - (__s64)rtt)) >> net->sctp.rto_beta);
+                       + (((__u32)abs((__s64)tp->srtt - (__s64)rtt)) >> net->sctp.rto_beta);
                tp->srtt = tp->srtt - (tp->srtt >> net->sctp.rto_alpha)
                        + (rtt >> net->sctp.rto_alpha);
        } else {