Skip to content

Commit 0d33f8e

Browse files
committed
use less confusing names for iov_iter direction initializers
Bugzilla: https://bugzilla.redhat.com/1971938 Conflicts: limited to the scope of the backport commit de4eda9 Author: Al Viro <viro@zeniv.linux.org.uk> Date: Thu Sep 15 20:25:47 2022 -0400 use less confusing names for iov_iter direction initializers READ/WRITE proved to be actively confusing - the meanings are "data destination, as used with read(2)" and "data source, as used with write(2)", but people keep interpreting those as "we read data from it" and "we write data to it", i.e. exactly the wrong way. Call them ITER_DEST and ITER_SOURCE - at least that is harder to misinterpret... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 8125ccb commit 0d33f8e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device)
781781

782782
kvec.iov_base = (void *)firmware->data;
783783
kvec.iov_len = firmware->size;
784-
iov_iter_kvec(&iter, WRITE, &kvec, 1, firmware->size);
784+
iov_iter_kvec(&iter, ITER_SOURCE, &kvec, 1, firmware->size);
785785
ret = generic_load_microcode(cpu, &iter);
786786

787787
release_firmware(firmware);

include/linux/uio.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ enum iter_type {
2828
ITER_DISCARD,
2929
};
3030

31+
#define ITER_SOURCE 1 // == WRITE
32+
#define ITER_DEST 0 // == READ
33+
3134
struct iov_iter_state {
3235
size_t iov_offset;
3336
size_t count;

0 commit comments

Comments
 (0)