summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/dos.c
diff options
context:
space:
mode:
authorSami Kerola2016-07-04 23:09:10 +0200
committerSami Kerola2016-07-21 22:14:33 +0200
commit74ce680a3ef90503b26da0a34f04cf725f6c5beb (patch)
tree307baa695e1c36c7a7855718468d9913ddf96bc1 /libfdisk/src/dos.c
parentagetty: call uname() only when necessary (diff)
downloadkernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.gz
kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.xz
kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.zip
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libfdisk/src/dos.c')
-rw-r--r--libfdisk/src/dos.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
index b2e1c6038..5ea56c2ed 100644
--- a/libfdisk/src/dos.c
+++ b/libfdisk/src/dos.c
@@ -1204,20 +1204,18 @@ static int add_partition(struct fdisk_context *cxt, size_t n,
(uintmax_t)start, (uintmax_t)stop, cxt->grain));
}
- if (stop < limit) {
- if (isrel && alignment_required(cxt)) {
- /* the last sector has not been exactly requested (but
- * defined by +size{K,M,G} convention), so be smart and
- * align the end of the partition. The next partition
- * will start at phy.block boundary.
- */
- stop = fdisk_align_lba_in_range(cxt, stop, start, limit);
- if (stop > start)
- stop -= 1;
- if (stop > limit)
- stop = limit;
- DBG(LABEL, ul_debug("DOS: aligned stop: %ju", (uintmax_t) stop));
- }
+ if (stop < limit && isrel && alignment_required(cxt)) {
+ /* the last sector has not been exactly requested (but
+ * defined by +size{K,M,G} convention), so be smart and
+ * align the end of the partition. The next partition
+ * will start at phy.block boundary.
+ */
+ stop = fdisk_align_lba_in_range(cxt, stop, start, limit);
+ if (stop > start)
+ stop -= 1;
+ if (stop > limit)
+ stop = limit;
+ DBG(LABEL, ul_debug("DOS: aligned stop: %ju", (uintmax_t) stop));
}
set_partition(cxt, n, 0, start, stop, sys, fdisk_partition_is_bootable(pa));