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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 18, 2023 at 11:17:41PM +0000, David Howells wrote:
> Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> 
> > > Change the ITER_SOURCE and ITER_DEST direction macros into an enum and
> > > provide three new helper functions:
> > > 
> > >  iov_iter_dir() - returns the iterator direction
> > >  iov_iter_is_dest() - returns true if it's an ITER_DEST iterator
> > >  iov_iter_is_source() - returns true if it's an ITER_SOURCE iterator
> > 
> > What for?  We have two valid values -
> > 	1) it is a data source
> > 	2) it is not a data source
> > Why do we need to store that as an enum?
> 
> Compile time type checking.

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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux