Fix calculation of alignment for odd values. Also do not change value

when it is already aligned.
This commit is contained in:
Andrey V. Elsukov 2011-05-24 16:49:34 +00:00
parent 2956ec9bc7
commit 72b066244c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=222263

View File

@ -295,8 +295,8 @@ fmtattrib(struct gprovider *pp)
return (buf); return (buf);
} }
#define ALIGNDOWN(d, a) (-(a) & (d)) #define ALIGNDOWN(d, a) ((d) % (a) ? (d) - (d) % (a): (d))
#define ALIGNUP(d, a) (-(-(a) & -(d))) #define ALIGNUP(d, a) ((d) % (a) ? (d) - (d) % (a) + (a): (d))
static int static int
gpart_autofill_resize(struct gctl_req *req) gpart_autofill_resize(struct gctl_req *req)