[PATCH] iov_iter: Update direction initializers to new naming convention

Breno Leitao posted 1 patch 1 year, 6 months ago
include/linux/uio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] iov_iter: Update direction initializers to new naming convention
Posted by Breno Leitao 1 year, 6 months ago
Commit de4eda9de2d95 ("use less confusing names for iov_iter direction
initializers") updated the direction initializers from READ/WRITE to the
more intuitive ITER_DEST and ITER_SOURCE.

However, the function iov_iter_ubuf() is still using the old READ/WRITE
names, which could confuse readers who might expect the new
ITER_DEST/ITER_SOURCE arguments.

Update iov_iter_ubuf() to use the new ITER_DEST/ITER_SOURCE macros,
removing the old and confusing READ/WRITE macros.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 include/linux/uio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/uio.h b/include/linux/uio.h
index 7020adedfa08..aa1ca69febaa 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -347,7 +347,7 @@ int import_ubuf(int type, void __user *buf, size_t len, struct iov_iter *i);
 static inline void iov_iter_ubuf(struct iov_iter *i, unsigned int direction,
 			void __user *buf, size_t count)
 {
-	WARN_ON(direction & ~(READ | WRITE));
+	WARN_ON(direction & ~(ITER_DEST | ITER_SOURCE));
 	*i = (struct iov_iter) {
 		.iter_type = ITER_UBUF,
 		.data_source = direction,
-- 
2.43.0