diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-02-07 07:43:18 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-02-07 07:43:18 +0000 |
commit | 901b050b36b991a9399acfb9c3eeb33704c5af03 (patch) | |
tree | f72f42efccdbad72ca19171434eed2d5a0f94e3c | |
parent | e39661251110e8adc8e665b4139d24c5db0fceca (diff) | |
download | src-901b050b36b991a9399acfb9c3eeb33704c5af03.tar.gz src-901b050b36b991a9399acfb9c3eeb33704c5af03.zip |
bsdlabel: Remove a write-only variable.
Since r149061 (2005) the total_size variable is write-only.
Differential Revision: https://reviews.freebsd.org/D38368
MFC after: 2 weeks
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 943f37207fc2..efe7eebf23c6 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -1094,7 +1094,7 @@ checklabel(struct disklabel *lp) struct partition *pp; int i, errors = 0; char part; - u_long base_offset, needed, total_size, total_percent, current_offset; + u_long base_offset, needed, total_percent, current_offset; long free_space; int seen_default_offset; int hog_part; @@ -1173,7 +1173,6 @@ checklabel(struct disklabel *lp) /* first allocate space to the partitions, then offsets */ - total_size = 0; /* in sectors */ total_percent = 0; /* in percent */ hog_part = -1; /* find all fixed partitions */ @@ -1234,9 +1233,6 @@ checklabel(struct disklabel *lp) size /= lp->d_secsize; pp->p_size = size; } - /* else already in sectors */ - if (i != RAW_PART) - total_size += size; } } } @@ -1272,7 +1268,6 @@ checklabel(struct disklabel *lp) if (part_set[i] && part_size_type[i] == '%') { /* careful of overflows! and integer roundoff */ pp->p_size = ((double)pp->p_size/100) * free_space; - total_size += pp->p_size; /* FIX we can lose a sector or so due to roundoff per partition. A more complex algorithm could avoid that */ @@ -1328,7 +1323,6 @@ checklabel(struct disklabel *lp) } else { lp->d_partitions[hog_part].p_size = current_offset - base_offset - needed; - total_size += lp->d_partitions[hog_part].p_size; } } |