libnl-tiny: fix duplicated branch in family.h
authorJesus Fernandez Manzano <jesus.manzano@galgus.net>
Tue, 13 Dec 2022 17:14:33 +0000 (18:14 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 6 Jan 2023 18:55:57 +0000 (19:55 +0100)
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@galgus.net>
include/netlink/genl/family.h

index ca71181e89f322a4012f641395602721e565c852..1c3689499d3b45ae87a5cc10a1a9d935aabe0159 100644 (file)
@@ -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)