From 294a5065d814d3fecc4cffec2f5c75eb76fbd5fe Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 25 Jan 2008 11:32:40 +0200 Subject: ubi-utils: use macros not hardcoded constants Signed-off-by: Artem Bityutskiy --- ubi-utils/src/libubigen.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ubi-utils') diff --git a/ubi-utils/src/libubigen.c b/ubi-utils/src/libubigen.c index ff7602e..a82d9c2 100644 --- a/ubi-utils/src/libubigen.c +++ b/ubi-utils/src/libubigen.c @@ -303,10 +303,11 @@ int ubigen_write_layout_vol(const struct ubigen_info *ui, vi.bytes = ui->leb_size * UBI_LAYOUT_VOLUME_EBS; vi.id = UBI_LAYOUT_VOLUME_ID; - vi.alignment = 1; - vi.data_pad = 0; - vi.usable_leb_size = ui->leb_size; - vi.type = UBI_VID_DYNAMIC; + vi.alignment = UBI_LAYOUT_VOLUME_ALIGN; + vi.data_pad = ui->leb_size % UBI_LAYOUT_VOLUME_ALIGN; + vi.usable_leb_size = ui->leb_size - vi.data_pad; + vi.data_pad = ui->leb_size - vi.usable_leb_size; + vi.type = UBI_LAYOUT_VOLUME_TYPE; vi.name = UBI_LAYOUT_VOLUME_NAME; vi.name_len = strlen(UBI_LAYOUT_VOLUME_NAME); vi.compat = UBI_LAYOUT_VOLUME_COMPAT; -- cgit v1.2.3