]> git.baikalelectronics.ru Git - kernel.git/commit
iosys-map: Add per-word write
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 28 Jun 2022 19:10:16 +0000 (12:10 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 30 Jun 2022 00:42:28 +0000 (17:42 -0700)
commit0bc193e89383a4545b718041650fbea42460a2e1
tree286b3ec743d32cac4efdae9630b01980afe8728c
parent2c18c0b3b1303f5621ce8084105f2ddc5bfb13ee
iosys-map: Add per-word write

Like was done for read, provide the equivalent for write. Even if
current users are not in the hot path, this should future-proof it.

v2:
  - Remove default from _Generic() - callers wanting to write more
    than u64 should use iosys_map_memcpy_to()
  - Add WRITE_ONCE() cases dereferencing the pointer when using system
    memory
v3:
  - Fix precedence issue when casting inside WRITE_ONCE(). By not using ()
    around vaddr__ the offset was not part of the cast, but rather added
    to it, producing a wrong address
  - Remove compiletime_assert() as WRITE_ONCE() already contains it

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Reviewed-by: Christian König <christian.koenig@amd.com> # v1
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220628191016.3899428-2-lucas.demarchi@intel.com
include/linux/iosys-map.h