On Mon, Dec 14, 2020 at 11:52:48PM +0400, Dmitrii Banshchikov wrote: > + } else if (reg->type == PTR_TO_SOCKET_OR_NULL) { > + reg->type = PTR_TO_SOCKET; > + } else if (reg->type == PTR_TO_SOCK_COMMON_OR_NULL) { > + reg->type = PTR_TO_SOCK_COMMON; > + } else if (reg->type == PTR_TO_TCP_SOCK_OR_NULL) { > + reg->type = PTR_TO_TCP_SOCK; > + } else if (reg->type == PTR_TO_BTF_ID_OR_NULL) { > + reg->type = PTR_TO_BTF_ID; > + } else if (reg->type == PTR_TO_MEM_OR_NULL) { > + reg->type = PTR_TO_MEM; > + } else if (reg->type == PTR_TO_RDONLY_BUF_OR_NULL) { > + reg->type = PTR_TO_RDONLY_BUF; > + } else if (reg->type == PTR_TO_RDWR_BUF_OR_NULL) { > + reg->type = PTR_TO_RDWR_BUF; > + } else { > + return -EINVAL; In other places we've converted such sequences of if-s into switch statements. Probably makes sense to do it here as well.