hide the bitwise operations by using S_ISFIFO, which has a more
informative name, to improve the code readability
make the code more compact, so that the whole expression to check the
file type can fit in one line, and there is no need to use the inode
pointer, which is not used in other places
the implementation of S_ISFIFO is maintained by the kernel, so it
will not affect the module code in case that the kernel changes the
name of S_IFIFO or S_IFMT, though it might not be likely to
happen
There are serveral advantages by using the macro:
hide the bitwise operations by using
S_ISFIFO
, which has a more informative name, to improve the code readabilitymake the code more compact, so that the whole expression to check the file type can fit in one line, and there is no need to use the inode pointer, which is not used in other places
the implementation of
S_ISFIFO
is maintained by the kernel, so it will not affect the module code in case that the kernel changes the name ofS_IFIFO
orS_IFMT
, though it might not be likely to happen