program: Make start_sector unsigned in

For unknown reasons start_sector was a staring, turn it into an unsigned
integer instead.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2021-04-15 14:20:41 -05:00
parent 56076936a6
commit b6e0ea31d7
3 changed files with 4 additions and 4 deletions

View File

@@ -336,7 +336,7 @@ static int firehose_program(struct qdl_device *qdl, struct program *program, int
xml_setpropf(node, "SECTOR_SIZE_IN_BYTES", "%d", program->sector_size);
xml_setpropf(node, "num_partition_sectors", "%d", num_sectors);
xml_setpropf(node, "physical_partition_number", "%d", program->partition);
xml_setpropf(node, "start_sector", "%s", program->start_sector);
xml_setpropf(node, "start_sector", "%d", program->start_sector);
if (program->filename)
xml_setpropf(node, "filename", "%s", program->filename);
@@ -415,7 +415,7 @@ static int firehose_apply_patch(struct qdl_device *qdl, struct patch *patch)
xml_setpropf(node, "filename", "%s", patch->filename);
xml_setpropf(node, "physical_partition_number", "%d", patch->partition);
xml_setpropf(node, "size_in_bytes", "%d", patch->size_in_bytes);
xml_setpropf(node, "start_sector", "%s", patch->start_sector);
xml_setpropf(node, "start_sector", "%d", patch->start_sector);
xml_setpropf(node, "value", "%s", patch->value);
ret = firehose_write(qdl, doc);

View File

@@ -75,7 +75,7 @@ int program_load(const char *program_file)
program->label = attr_as_string(node, "label", &errors);
program->num_sectors = attr_as_unsigned(node, "num_partition_sectors", &errors);
program->partition = attr_as_unsigned(node, "physical_partition_number", &errors);
program->start_sector = attr_as_string(node, "start_sector", &errors);
program->start_sector = attr_as_unsigned(node, "start_sector", &errors);
if (errors) {
fprintf(stderr, "[PROGRAM] errors while parsing program\n");

View File

@@ -11,7 +11,7 @@ struct program {
const char *label;
unsigned num_sectors;
unsigned partition;
const char *start_sector;
unsigned start_sector;
struct program *next;
};