diff options
author | Karel Zak | 2017-06-27 11:26:41 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-27 11:26:41 +0200 |
commit | 08029093b09d39f6d01ec7aaee9e9be84be17259 (patch) | |
tree | 02bb1ad1a1105b8a57a0cff7379aea5098d2e88f /libblkid | |
parent | Merge branch 'travis-fix' of https://github.com/rudimeier/util-linux (diff) | |
download | kernel-qcow2-util-linux-08029093b09d39f6d01ec7aaee9e9be84be17259.tar.gz kernel-qcow2-util-linux-08029093b09d39f6d01ec7aaee9e9be84be17259.tar.xz kernel-qcow2-util-linux-08029093b09d39f6d01ec7aaee9e9be84be17259.zip |
libblkid: remove dead code and blkid_probe_new_value()
The function blkid_probe_new_value() is unnecessary.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/probe.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index 77c46cccc..b2926e91a 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); @@ -301,27 +300,6 @@ static void blkid_probe_chain_reset_position(struct blkid_chain *chn) } /* -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 */ int blkid_probe_chain_save_values(blkid_probe pr, struct blkid_chain *chn, @@ -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, |