[PATCH] libnl-tiny: fix duplicated branch in family.h
Jesus Fernandez Manzano
jesus.manzano at galgus.net
Tue Dec 13 09:14:33 PST 2022
Duplicated branch in function genl_family_get_maxattr().
Detected by gcc with -Werror=duplicated-branches.
libnl-tiny/netlink/genl/family.h:118:5: error: this condition has
identical branches [-Werror=duplicated-branches]
if (family->ce_mask & FAMILY_ATTR_MAXATTR)
Signed-off-by: Jesus Fernandez Manzano <jesus.manzano at galgus.net>
---
include/netlink/genl/family.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/netlink/genl/family.h b/include/netlink/genl/family.h
index ca71181..1c36894 100644
--- a/include/netlink/genl/family.h
+++ b/include/netlink/genl/family.h
@@ -119,7 +119,7 @@ static inline uint32_t genl_family_get_maxattr(struct genl_family *family)
if (family->ce_mask & FAMILY_ATTR_MAXATTR)
return family->gf_maxattr;
else
- return family->gf_maxattr;
+ return 0;
}
static inline void genl_family_set_maxattr(struct genl_family *family, uint32_t maxattr)
--
2.25.1
More information about the openwrt-devel
mailing list