linux_dsm_epyc7002/arch/x86/include/asm
Krzysztof Kozlowski 00085f1efa dma-mapping: use unsigned long for dma_attrs
The dma-mapping core and the implementations do not change the DMA
attributes passed by pointer.  Thus the pointer can point to const data.
However the attributes do not have to be a bitfield.  Instead unsigned
long will do fine:

1. This is just simpler.  Both in terms of reading the code and setting
   attributes.  Instead of initializing local attributes on the stack
   and passing pointer to it to dma_set_attr(), just set the bits.

2. It brings safeness and checking for const correctness because the
   attributes are passed by value.

Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
     )

and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
     )

Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
Acked-by: Mark Salter <msalter@redhat.com> [c6x]
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> [cris]
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> [drm]
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
Acked-by: Fabien Dessenne <fabien.dessenne@st.com> [bdisp]
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> [vb2-core]
Acked-by: David Vrabel <david.vrabel@citrix.com> [xen]
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [xen swiotlb]
Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon]
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390]
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> [avr32]
Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc]
Acked-by: Robin Murphy <robin.murphy@arm.com> [arm64 and dma-iommu]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-08-04 08:50:07 -04:00
..
crypto
fpu tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
numachip
trace x86/fpu: Add tracepoints to dump FPU state at key points 2016-06-08 13:33:33 +02:00
uv
xen dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
a.out-core.h
acenv.h
acpi.h Merge branch 'acpi-tables' 2016-07-25 13:41:01 +02:00
agp.h
alternative-asm.h
alternative.h
amd_nb.h
apb_timer.h
apic_flat_64.h
apic.h x86/apic: Remove the unused struct apic::apic_id_mask field 2016-07-15 10:39:05 +02:00
apicdef.h
apm.h x86, asm: use bool for bitops and other assembly outputs 2016-06-08 12:41:20 -07:00
arch_hweight.h x86/hweight: Get rid of the special calling convention 2016-06-08 15:01:02 +02:00
archrandom.h x86, asm: Use CC_SET()/CC_OUT() and static_cpu_has() in archrandom.h 2016-06-08 12:41:20 -07:00
asm-offsets.h
asm.h x86, asm: define CC_SET() and CC_OUT() macros 2016-06-08 12:41:20 -07:00
atomic64_32.h locking/atomic, arch/x86: Implement atomic{,64}_fetch_{add,sub,and,or,xor}() 2016-06-16 10:48:31 +02:00
atomic64_64.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 15:34:18 -07:00
atomic.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 15:34:18 -07:00
barrier.h
bios_ebda.h x86/boot: Reorganize and clean up the BIOS area reservation code 2016-07-21 10:11:57 +02:00
bitops.h x86, asm: Use CC_SET()/CC_OUT() in <asm/bitops.h> 2016-06-08 12:41:20 -07:00
boot.h x86/KASLR: Build identity mappings on demand 2016-05-07 07:38:39 +02:00
bootparam_utils.h
bug.h
bugs.h x86/mm/mpx: Work around MPX erratum SKD046 2016-05-20 09:07:40 +02:00
cache.h
cacheflush.h
calgary.h
ce4100.h
checksum_32.h x86/uaccess: Move thread_info::addr_limit to thread_struct 2016-07-15 10:26:30 +02:00
checksum_64.h
checksum.h
clocksource.h
cmdline.h
cmpxchg_32.h
cmpxchg_64.h
cmpxchg.h
compat.h x86/signals: Add missing signal_compat code for x86 features 2016-06-14 12:19:24 +02:00
cpu_device_id.h
cpu.h xen: features and fixes for 4.8-rc0 2016-07-27 11:35:37 -07:00
cpufeature.h x86/cpufeature: Add helper macro for mask check macros 2016-06-30 09:11:32 +02:00
cpufeatures.h Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-30 12:56:26 -07:00
cpumask.h
crash.h
current.h
debugreg.h
delay.h
desc_defs.h
desc.h
device.h
disabled-features.h x86/cpufeature: Make sure DISABLED/REQUIRED macros are updated 2016-06-30 09:11:32 +02:00
div64.h
dma-mapping.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
dma.h
dmi.h
dwarf2.h
e820.h
edac.h
efi.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 15:34:18 -07:00
elf.h tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
emergency-restart.h
entry_arch.h
espfix.h
exec.h
fb.h
fixmap.h
floppy.h
frame.h
ftrace.h
futex.h
gart.h
genapic.h
geode.h
hardirq.h
highmem.h
hpet.h
hugetlb.h
hw_breakpoint.h
hw_irq.h
hypertransport.h
hypervisor.h
i8259.h
ia32_unistd.h
ia32.h
idle.h
imr.h
inat_types.h
inat.h x86/insn: Add AVX-512 support to the instruction decoder 2016-07-21 09:37:11 -03:00
init.h
insn.h x86/insn: Add AVX-512 support to the instruction decoder 2016-07-21 09:37:11 -03:00
inst.h
intel_mid_vrtc.h
intel_pmc_ipc.h
intel_pt.h
intel_punit_ipc.h
intel_scu_ipc.h
intel_telemetry.h
intel-family.h Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-30 12:56:26 -07:00
intel-mid.h x86/sfi: Enable enumeration of SD devices 2016-07-13 09:24:51 +02:00
io_apic.h
io.h
iomap.h
iommu_table.h
iommu.h
iosf_mbi.h
ipi.h
irq_regs.h
irq_remapping.h
irq_vectors.h
irq_work.h
irq.h
irqdomain.h
irqflags.h
ist.h
jump_label.h
kasan.h
kaslr.h x86/mm: Enable KASLR for vmalloc memory regions 2016-07-08 17:35:21 +02:00
kbdleds.h
Kbuild kbuild, x86: Track generated headers with generated-y 2016-07-07 15:58:44 +02:00
kdebug.h x86/dumpstack: Add show_stack_regs() and use it 2016-07-08 11:33:19 +02:00
kexec-bzimage64.h
kexec.h
kgdb.h
kmap_types.h
kmemcheck.h
kprobes.h x86: fix up a few misc stack pointer vs thread_info confusions 2016-06-24 16:55:53 -07:00
kvm_emulate.h
kvm_guest.h
kvm_host.h - ARM: GICv3 ITS emulation and various fixes. Removal of the old 2016-08-02 16:11:27 -04:00
kvm_page_track.h
kvm_para.h
lguest_hcall.h
lguest.h
linkage.h
livepatch.h x86: Audit and remove any remaining unnecessary uses of module.h 2016-07-14 15:07:00 +02:00
local64.h
local.h x86, asm: change the GEN_*_RMWcc() macros to not quote the condition 2016-06-08 12:41:20 -07:00
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h
mce.h x86/mce/AMD: Log Deferred Errors using SMCA MCA_DE{STAT,ADDR} registers 2016-05-12 09:08:19 +02:00
microcode_amd.h x86/microcode/AMD: Make amd_ucode_patch[] static 2016-06-08 11:04:20 +02:00
microcode_intel.h x86/microcode/intel: Unexport save_mc_for_early() 2016-06-08 11:04:20 +02:00
microcode.h x86/microcode: Fix suspend to RAM with builtin microcode 2016-06-08 11:04:19 +02:00
misc.h
mmconfig.h
mmu_context.h tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
mmu.h
mmx.h
mmzone_32.h
mmzone_64.h
mmzone.h
module.h
mpspec_def.h
mpspec.h
mpx.h
mshyperv.h
msi.h
msidef.h
msr-index.h x86: remove duplicate turbo ratio limit MSRs 2016-07-07 15:32:00 +02:00
msr-trace.h
msr.h x86/msr: Use the proper trace point conditional for writes 2016-06-06 15:33:39 +02:00
mtrr.h
mutex_32.h locking/mutex: Optimize mutex_trylock() fast-path 2016-06-08 15:17:01 +02:00
mutex_64.h locking/mutex: Optimize mutex_trylock() fast-path 2016-06-08 15:17:01 +02:00
mutex.h
mwait.h x86/cpu: Add workaround for MONITOR instruction erratum on Goldmont based CPUs 2016-07-20 09:48:40 +02:00
nmi.h
nops.h
numa_32.h
numa.h
olpc_ofw.h
olpc.h
page_32_types.h x86/asm, x86/microcode: Add __PAGE_OFFSET_BASE define on 32-bit 2016-07-27 14:59:59 +02:00
page_32.h
page_64_types.h x86/mm: Enable KASLR for physical mapping memory regions 2016-07-08 17:35:15 +02:00
page_64.h
page_types.h
page.h
paravirt_types.h Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-05-16 15:54:01 -07:00
paravirt.h Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-05-16 15:54:01 -07:00
parport.h
pat.h
pci_64.h
pci_x86.h
pci-direct.h
pci-functions.h
pci.h
percpu.h x86, asm: Use CC_SET()/CC_OUT() in <asm/percpu.h> 2016-06-08 12:41:20 -07:00
perf_event_p4.h
perf_event.h
pgalloc.h arch: x86: charge page tables to kmemcg 2016-07-26 16:19:19 -07:00
pgtable_32_types.h
pgtable_32.h
pgtable_64_types.h x86/mm: Enable KASLR for vmalloc memory regions 2016-07-08 17:35:21 +02:00
pgtable_64.h x86/mm: Move swap offset/type up in PTE to work around erratum 2016-07-13 09:43:25 +02:00
pgtable_types.h x86/mm: Remove kernel_unmap_pages_in_pgd() and efi_cleanup_page_tables() 2016-07-15 10:26:26 +02:00
pgtable-2level_types.h
pgtable-2level.h
pgtable-3level_types.h
pgtable-3level.h
pgtable.h Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 17:32:28 -07:00
pkeys.h
platform_sst_audio.h
pm-trace.h
pmc_atom.h
pmc_core.h platform/x86: Add PMC Driver for Intel Core SoC 2016-05-27 11:47:56 -07:00
pmem.h pmem: kill __pmem address space 2016-07-12 19:25:38 -07:00
posix_types.h
preempt.h x86, asm: change the GEN_*_RMWcc() macros to not quote the condition 2016-06-08 12:41:20 -07:00
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.h Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 18:48:27 -07:00
prom.h
proto.h
ptrace.h x86/entry: Get rid of two-phase syscall entry work 2016-06-14 10:54:39 -07:00
pvclock-abi.h
pvclock.h pvclock: Cleanup to remove function pvclock_get_nsec_offset 2016-06-27 15:12:14 +02:00
qrwlock.h
qspinlock_paravirt.h
qspinlock.h
realmode.h
reboot_fixups.h
reboot.h
required-features.h x86/cpufeature: Make sure DISABLED/REQUIRED macros are updated 2016-06-30 09:11:32 +02:00
rio.h
rmwcc.h x86, asm: change GEN_*_RMWcc() to use CC_SET()/CC_OUT() 2016-06-08 12:41:20 -07:00
rtc.h
rwsem.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 15:34:18 -07:00
seccomp.h
sections.h
segment.h
serial.h
setup_arch.h
setup.h
shmparam.h
sigcontext.h
sigframe.h
sighandling.h
signal.h x86, bitops: remove use of "sbb" to return CF 2016-06-08 12:41:20 -07:00
simd.h
smap.h
smp.h xen: features and fixes for 4.8-rc0 2016-07-27 11:35:37 -07:00
sparsemem.h
special_insns.h x86/insn: remove pcommit 2016-07-23 11:04:23 -07:00
spinlock_types.h
spinlock.h
sta2x11.h
stackprotector.h
stacktrace.h x86: avoid avoid passing around 'thread_info' in stack dumping code 2016-06-23 12:20:01 -07:00
string_32.h
string_64.h
string.h
suspend_32.h
suspend_64.h
suspend.h
svm.h x86/kvm/svm: Simplify cpu_has_svm() 2016-06-16 00:04:31 +02:00
swiotlb.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
switch_to.h
sync_bitops.h x86, bitops: remove use of "sbb" to return CF 2016-06-08 12:41:20 -07:00
sys_ia32.h
syscall.h
syscalls.h
sysfb.h
tce.h
text-patching.h
thread_info.h signal: consolidate {TS,TLF}_RESTORE_SIGMASK code 2016-08-02 19:35:23 -04:00
time.h
timer.h
timex.h
tlb.h
tlbflush.h
topology.h Merge branch 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-08-01 14:23:42 -04:00
trace_clock.h
traps.h
tsc.h x86/tsc: Remove the unused check_tsc_disabled() 2016-07-15 10:35:08 +02:00
uaccess_32.h x86: remove more uaccess_32.h complexity 2016-05-22 17:21:27 -07:00
uaccess_64.h x86/kasan: instrument user memory access API 2016-05-20 17:58:30 -07:00
uaccess.h x86/uaccess: Move thread_info::addr_limit to thread_struct 2016-07-15 10:26:30 +02:00
unaligned.h
unistd.h x86/syscalls: Add compat_sys_preadv64v2/compat_sys_pwritev64v2 2016-07-15 10:30:26 +02:00
uprobes.h
user32.h
user_32.h
user_64.h
user.h
vdso.h
vga.h
vgtod.h
virtext.h x86/kvm/svm: Simplify cpu_has_svm() 2016-06-16 00:04:31 +02:00
vm86.h
vmx.h Revert "KVM: x86: add pcommit support" 2016-07-23 11:04:23 -07:00
vsyscall.h
vvar.h
word-at-a-time.h
x2apic.h
x86_init.h Merge branch 'x86-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 19:41:35 -07:00
xor_32.h
xor_64.h
xor_avx.h
xor.h