tree-wide: use !IN_SET(..) for a != b && a != c && …
The included cocci was used to generate the changes. Thanks to @flo-wer for pointing this case out.
This commit is contained in:
+1
-1
@@ -202,7 +202,7 @@ int rm_rf(const char *path, RemoveFlags flags) {
|
||||
fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
|
||||
if (fd < 0) {
|
||||
|
||||
if (errno != ENOTDIR && errno != ELOOP)
|
||||
if (!IN_SET(errno, ENOTDIR, ELOOP))
|
||||
return -errno;
|
||||
|
||||
if (!(flags & REMOVE_PHYSICAL)) {
|
||||
|
||||
@@ -268,7 +268,7 @@ int socket_address_verify(const SocketAddress *a) {
|
||||
if (a->sockaddr.in.sin_port == 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM)
|
||||
if (!IN_SET(a->type, SOCK_STREAM, SOCK_DGRAM))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
@@ -280,7 +280,7 @@ int socket_address_verify(const SocketAddress *a) {
|
||||
if (a->sockaddr.in6.sin6_port == 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM)
|
||||
if (!IN_SET(a->type, SOCK_STREAM, SOCK_DGRAM))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
@@ -304,7 +304,7 @@ int socket_address_verify(const SocketAddress *a) {
|
||||
}
|
||||
}
|
||||
|
||||
if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM && a->type != SOCK_SEQPACKET)
|
||||
if (!IN_SET(a->type, SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
@@ -314,7 +314,7 @@ int socket_address_verify(const SocketAddress *a) {
|
||||
if (a->size != sizeof(struct sockaddr_nl))
|
||||
return -EINVAL;
|
||||
|
||||
if (a->type != SOCK_RAW && a->type != SOCK_DGRAM)
|
||||
if (!IN_SET(a->type, SOCK_RAW, SOCK_DGRAM))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
@@ -323,7 +323,7 @@ int socket_address_verify(const SocketAddress *a) {
|
||||
if (a->size != sizeof(struct sockaddr_vm))
|
||||
return -EINVAL;
|
||||
|
||||
if (a->type != SOCK_STREAM && a->type != SOCK_DGRAM)
|
||||
if (!IN_SET(a->type, SOCK_STREAM, SOCK_DGRAM))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user