]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Do not cast to the same type as the destination is 14510/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 29 Sep 2023 06:17:56 +0000 (09:17 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 29 Sep 2023 07:24:16 +0000 (10:24 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_evpn_vty.c
bgpd/bgp_linkstate_tlv.c
lib/darr.c
lib/if.c
lib/link_state.c
ospf6d/ospf6_gr_helper.c
sharpd/sharp_vty.c
zebra/tc_netlink.c

index e4c7fdb124f0af396e7a6d0cde966731a05420c4..eb9f34ef02ad19fe12184161f5d199bbd6a75b5f 100644 (file)
@@ -2687,16 +2687,16 @@ static void evpn_show_route_vni_macip(struct vty *vty, struct bgp *bgp,
                 */
                if (is_evpn_prefix_ipaddr_none(evp)) {
                        /* VNI MAC -> Global */
-                       evpn_type2_prefix_global_copy(
-                               (struct prefix_evpn *)&tmp_p, evp,
-                               NULL /* mac */,
-                               evpn_type2_path_info_get_ip(pi));
+                       evpn_type2_prefix_global_copy(&tmp_p, evp,
+                                                     NULL /* mac */,
+                                                     evpn_type2_path_info_get_ip(
+                                                             pi));
                } else {
                        /* VNI IP -> Global */
-                       evpn_type2_prefix_global_copy(
-                               (struct prefix_evpn *)&tmp_p, evp,
-                               evpn_type2_path_info_get_mac(pi),
-                               NULL /* ip */);
+                       evpn_type2_prefix_global_copy(&tmp_p, evp,
+                                                     evpn_type2_path_info_get_mac(
+                                                             pi),
+                                                     NULL /* ip */);
                }
 
                route_vty_out_detail(vty, bgp, dest, (struct prefix *)&tmp_p,
index 3669d68b85044439c0a66645b1a734234be4fbb1..fbec96a907f109dc4b5b25b479978b53d3e32841 100644 (file)
@@ -1066,10 +1066,9 @@ static void bgp_linkstate_tlv_sid_display(struct vty *vty, uint8_t *pnt,
                        /* IS-IS System-ID */
                        if (json)
                                json_object_string_addf(json_data, "neighborId",
-                                                       "%pSY\n",
-                                                       (uint8_t *)pnt);
+                                                       "%pSY\n", pnt);
                        else
-                               vty_out(vty, "%pSY\n", (uint8_t *)pnt);
+                               vty_out(vty, "%pSY\n", pnt);
                        pnt += 6;
                }
        }
index 2c8b7b8778a1c49e3a214ce7c703fdd1af269676..f0ef5c90be7c11678cac04b9164c939e6ea36105 100644 (file)
@@ -109,6 +109,6 @@ void *__darr_insert_n(void *a, uint at, uint count, size_t esize, bool zero)
                memset(_a_at(at), 0, esize * count);
        }
 
-       return (void *)a;
+       return a;
 #undef _a_at
 }
index 6f567861d19ca9d7d8de97eb46c5568438b2ab24..48c01af882a47538e59230ef43c598755a43de0e 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -98,8 +98,8 @@ int if_cmp_name_func(const char *p1, const char *p2)
                if (!*p2)
                        return 1;
 
-               x1 = strtol(p1, (char **)&tmp1, 10);
-               x2 = strtol(p2, (char **)&tmp2, 10);
+               x1 = strtol(p1, &tmp1, 10);
+               x2 = strtol(p2, &tmp2, 10);
 
                /* let's compare numbers now */
                if (x1 < x2)
index 105e3e28a96a8c63812de306331b3c124c5999e4..25373bdb20a58e998372e3788941d49f6256b1a8 100644 (file)
@@ -1739,7 +1739,7 @@ struct ls_message *ls_subnet2msg(struct ls_message *msg,
 struct ls_vertex *ls_msg2vertex(struct ls_ted *ted, struct ls_message *msg,
                                bool delete)
 {
-       struct ls_node *node = (struct ls_node *)msg->data.node;
+       struct ls_node *node = msg->data.node;
        struct ls_vertex *vertex = NULL;
 
        switch (msg->event) {
@@ -1779,7 +1779,7 @@ struct ls_vertex *ls_msg2vertex(struct ls_ted *ted, struct ls_message *msg,
 struct ls_edge *ls_msg2edge(struct ls_ted *ted, struct ls_message *msg,
                            bool delete)
 {
-       struct ls_attributes *attr = (struct ls_attributes *)msg->data.attr;
+       struct ls_attributes *attr = msg->data.attr;
        struct ls_edge *edge = NULL;
 
        switch (msg->event) {
@@ -1819,7 +1819,7 @@ struct ls_edge *ls_msg2edge(struct ls_ted *ted, struct ls_message *msg,
 struct ls_subnet *ls_msg2subnet(struct ls_ted *ted, struct ls_message *msg,
                                bool delete)
 {
-       struct ls_prefix *pref = (struct ls_prefix *)msg->data.prefix;
+       struct ls_prefix *pref = msg->data.prefix;
        struct ls_subnet *subnet = NULL;
 
        switch (msg->event) {
index 8159ac0cd3d3d7504fc28c050fd22829167da62d..be1042f260317f554e8bad0caa5b48adab37ac5b 100644 (file)
@@ -134,7 +134,7 @@ static int ospf6_extract_grace_lsa_fields(struct ospf6_lsa *lsa,
        uint16_t length = 0;
        int sum = 0;
 
-       lsah = (struct ospf6_lsa_header *)lsa->header;
+       lsah = lsa->header;
        if (ntohs(lsah->length) <= OSPF6_LSA_HEADER_SIZE) {
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug("%s: undersized (%u B) lsa", __func__,
@@ -1231,7 +1231,7 @@ static int ospf6_grace_lsa_show_info(struct vty *vty, struct ospf6_lsa *lsa,
        uint16_t length = 0;
        int sum = 0;
 
-       lsah = (struct ospf6_lsa_header *)lsa->header;
+       lsah = lsa->header;
        if (ntohs(lsah->length) <= OSPF6_LSA_HEADER_SIZE) {
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug("%s: undersized (%u B) lsa", __func__,
index e891c1b6be6ae492097275d264f9a3494eb4adf0..cf79bacc6b6e98968f089ba536acf7b620274101 100644 (file)
@@ -948,7 +948,7 @@ DEFPY (import_te,
 
 static void sharp_srv6_locator_chunk_free(struct prefix_ipv6 *chunk)
 {
-       prefix_ipv6_free((struct prefix_ipv6 **)&chunk);
+       prefix_ipv6_free(&chunk);
 }
 
 DEFPY (sharp_srv6_manager_get_locator_chunk,
index d0f4ed6d186208ed1a20b7905b90dd7e08592ec0..d633c07770cfa4c886941b1633b2a3b843ecd712 100644 (file)
@@ -160,7 +160,7 @@ static ssize_t netlink_qdisc_msg_encode(int cmd, struct zebra_dplane_ctx *ctx,
                struct nlmsghdr n;
                struct tcmsg t;
                char buf[0];
-       } *req = (void *)data;
+       } *req = data;
 
        if (datalen < sizeof(*req))
                return 0;
@@ -236,7 +236,7 @@ static ssize_t netlink_tclass_msg_encode(int cmd, struct zebra_dplane_ctx *ctx,
                struct nlmsghdr n;
                struct tcmsg t;
                char buf[0];
-       } *req = (void *)data;
+       } *req = data;
 
        if (datalen < sizeof(*req))
                return 0;
@@ -486,7 +486,7 @@ static ssize_t netlink_tfilter_msg_encode(int cmd, struct zebra_dplane_ctx *ctx,
                struct nlmsghdr n;
                struct tcmsg t;
                char buf[0];
-       } *req = (void *)data;
+       } *req = data;
 
        if (datalen < sizeof(*req))
                return 0;