]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: remove dead code and blkid_probe_new_value()
authorKarel Zak <kzak@redhat.com>
Tue, 27 Jun 2017 09:26:41 +0000 (11:26 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Jun 2017 09:26:41 +0000 (11:26 +0200)
The function blkid_probe_new_value() is unnecessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/probe.c

index 77c46ccccc4158c00b5ffd117dac88fbb7fefbf7..b2926e91a31b39fd2c6733a3849da68e9bf01a03 100644 (file)
@@ -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,