diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-02-25 21:30:31 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-02-26 00:00:46 +0100 |
commit | 9f5dc3192ed5325b39bdb0580700652b06440606 (patch) | |
tree | b880320cec863ad781dab6650592a942b19d92a1 /lib | |
parent | *: remove null check before XFREE (diff) | |
download | frr-9f5dc3192ed5325b39bdb0580700652b06440606.tar.xz frr-9f5dc3192ed5325b39bdb0580700652b06440606.zip |
*: remove casts of XMALLOC / XCALLOC
No cast necessary for void *
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filter.c | 6 | ||||
-rw-r--r-- | lib/prefix.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/filter.c b/lib/filter.c index 7df384f3b..276df4b4d 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -128,8 +128,7 @@ static struct access_master *access_master_get(afi_t afi) /* Allocate new filter structure. */ static struct filter *filter_new(void) { - return (struct filter *)XCALLOC(MTYPE_ACCESS_FILTER, - sizeof(struct filter)); + return XCALLOC(MTYPE_ACCESS_FILTER, sizeof(struct filter)); } static void filter_free(struct filter *filter) @@ -202,8 +201,7 @@ static int filter_match_zebra(struct filter *mfilter, const struct prefix *p) /* Allocate new access list structure. */ static struct access_list *access_list_new(void) { - return (struct access_list *)XCALLOC(MTYPE_ACCESS_LIST, - sizeof(struct access_list)); + return XCALLOC(MTYPE_ACCESS_LIST, sizeof(struct access_list)); } /* Free allocated access_list. */ diff --git a/lib/prefix.c b/lib/prefix.c index 72ae0e635..365a9ba38 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -1502,8 +1502,7 @@ char *prefix_mac2str(const struct ethaddr *mac, char *buf, int size) if (!mac) return NULL; if (!buf) - ptr = (char *)XMALLOC(MTYPE_TMP, - ETHER_ADDR_STRLEN * sizeof(char)); + ptr = XMALLOC(MTYPE_TMP, ETHER_ADDR_STRLEN * sizeof(char)); else { assert(size >= ETHER_ADDR_STRLEN); ptr = buf; @@ -1584,8 +1583,7 @@ char *esi_to_str(const esi_t *esi, char *buf, int size) if (!esi) return NULL; if (!buf) - ptr = (char *)XMALLOC(MTYPE_TMP, - ESI_STR_LEN * sizeof(char)); + ptr = XMALLOC(MTYPE_TMP, ESI_STR_LEN * sizeof(char)); else { assert(size >= ESI_STR_LEN); ptr = buf; |