From: Karel Zak Date: Tue, 27 Jun 2017 09:26:41 +0000 (+0200) Subject: libblkid: remove dead code and blkid_probe_new_value() X-Git-Tag: v2.31-rc1~258 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08029093b09d39f6d01ec7aaee9e9be84be17259;p=thirdparty%2Futil-linux.git libblkid: remove dead code and blkid_probe_new_value() The function blkid_probe_new_value() is unnecessary. Signed-off-by: Karel Zak --- diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index 77c46ccccc..b2926e91a3 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -124,7 +124,6 @@ static const struct blkid_chaindrv *chains_drvs[] = { [BLKID_CHAIN_PARTS] = &partitions_drv }; -static struct blkid_prval *blkid_probe_new_value(void); static void blkid_probe_reset_values(blkid_probe pr); static void blkid_probe_reset_buffer(blkid_probe pr); @@ -300,27 +299,6 @@ static void blkid_probe_chain_reset_position(struct blkid_chain *chn) chn->idx = -1; } -/* -static struct blkid_prval *blkid_probe_copy_value(struct blkid_prval *src) -{ - struct blkid_prval *dest = blkid_probe_new_value(); - - if (!dest) - return NULL; - - memcpy(dest, src, sizeof(struct blkid_prval)); - - dest->data = malloc(src->len); - if (!dest->data) - return NULL; - - memcpy(dest->data, src->data, src->len); - - INIT_LIST_HEAD(&dest->prvals); - return dest; -} -*/ - /* * Move chain values from probing result to @vals */ @@ -1373,10 +1351,11 @@ struct blkid_prval *blkid_probe_assign_value(blkid_probe pr, const char *name) { struct blkid_prval *v; - v = blkid_probe_new_value(); + v = calloc(1, sizeof(struct blkid_prval)); if (!v) return NULL; + INIT_LIST_HEAD(&v->prvals); v->name = name; v->chain = pr->cur_chain; list_add_tail(&v->prvals, &pr->values); @@ -1385,17 +1364,6 @@ struct blkid_prval *blkid_probe_assign_value(blkid_probe pr, const char *name) return v; } -static struct blkid_prval *blkid_probe_new_value(void) -{ - struct blkid_prval *v = calloc(1, sizeof(struct blkid_prval)); - if (!v) - return NULL; - - INIT_LIST_HEAD(&v->prvals); - - return v; -} - /* Note that value data is always terminated by zero to keep things robust, * this extra zero is not count to the value length. It's caller responsibility * to set proper value length (for strings we count terminator to the length,