Re: [PATCH v6 05/34] iov_iter: Change the direction macros into an enum

From: David Howells
Date: Wed Jan 18 2023 - 18:25:48 EST


Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:

> > Compile time type checking.
>
> Huh? int-to-enum conversion is quiet; it would catch explicit
> huge constants, but that's it...

*shrug*.

But can we at least get rid of the:

iov_iter_foo(&iter, ITER_SOURCE, ...);

WARN_ON(direction & ~(READ | WRITE));

mismatch? Either use ITER_SOURCE/DEST or use READ/WRITE but not mix them.

David