zipl/src: Add ->set_location() private method of program component

Add/use ->set_location() private method of struct component_footer
instead of checking component types every time when operating with
program components.

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Eduard Shishkin
2026-06-11 15:43:20 +02:00
committed by Jan Höppner
parent 4f622325ef
commit ee8897f9db
3 changed files with 57 additions and 27 deletions
+9
View File
@@ -58,6 +58,9 @@ struct component_footer {
* in the bootmap file. Otherwise, to
* phy_block_size boundary.
*/
void (*set_location)(struct component_loc *location,
address_t load_address, blocknum_t count,
int block_size);
};
struct program_component {
@@ -109,6 +112,12 @@ static inline enum scsi_layout get_scsi_layout(unsigned char *bootblock)
return scsi_layout_unknown;
}
static inline struct component_footer *
component_footer_by_id(enum program_component_id id)
{
return &component_footers[id];
}
static inline component_type component_type_by_id(enum program_component_id id)
{
return component_footers[id].type;