Apply suggestions from code review

Try to patch up ruff failures through suggestions.
This commit is contained in:
ikelos
2025-01-30 11:10:36 +00:00
committed by GitHub
parent d3e55db41d
commit f6106c8f19
2 changed files with 5 additions and 6 deletions
@@ -317,7 +317,7 @@ NET_DEVICE_FLAGS = {
# Kernels >= 2.6.17. See IF_OPER_* in include/uapi/linux/if.h
class IF_OPER_STATES(Enum):
class IF_OPER_STATES(enum.Enum):
"""RFC 2863 - Network interface operational status"""
UNKNOWN = 0
@@ -328,7 +328,7 @@ class IF_OPER_STATES(Enum):
DORMANT = 5
UP = 6
class ELF_IDENT(IntEnum):
class ELF_IDENT(enum.IntEnum):
"""ELF header e_ident indexes"""
EI_MAG0 = 0
@@ -459,4 +459,4 @@ Documentation :
- https://www.kernel.org/doc/Documentation/admin-guide/tainted-kernels.rst#:~:text=More%20detailed%20explanation%20for%20tainting
- taint_flag kernel struct
- taint_flags kernel constant
"""
"""
@@ -2053,8 +2053,7 @@ class inet6_dev(objects.StructType):
return
# 'if_list' member was added to 'inet6_ifaddr' type in kernels 3.0
for inet6_ifaddr in self.addr_list.to_list(inet6_ifaddr_symname, "if_list"):
yield inet6_ifaddr
yield from self.addr_list.to_list(inet6_ifaddr_symname, "if_list"):
class in_ifaddr(objects.StructType):
@@ -2112,7 +2111,7 @@ class inet6_ifaddr(objects.StructType):
return "host"
elif (self.scope & linux_constants.IFA_LINK) != 0:
return "link"
elif (self.scope & linuc_constants.IFA_SITE) != 0:
elif (self.scope & linux_constants.IFA_SITE) != 0:
return "site"
else:
return "global"