From 22001cb206c1320aee27f679a63d2171d35e99c5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 3 Dec 2013 16:48:56 +0000 Subject: [settings] Explicitly separate the concept of a completed fetched setting The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown --- src/interface/smbios/smbios_settings.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/interface/smbios') diff --git a/src/interface/smbios/smbios_settings.c b/src/interface/smbios/smbios_settings.c index ecd3f1d97..9995bd751 100644 --- a/src/interface/smbios/smbios_settings.c +++ b/src/interface/smbios/smbios_settings.c @@ -28,7 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include /** SMBIOS settings scope */ -static struct settings_scope smbios_settings_scope; +static const struct settings_scope smbios_settings_scope; /** * Construct SMBIOS raw-data tag @@ -63,7 +63,7 @@ static struct settings_scope smbios_settings_scope; * @ret applies Setting applies within this settings block */ static int smbios_applies ( struct settings *settings __unused, - struct setting *setting ) { + const struct setting *setting ) { return ( setting->scope == &smbios_settings_scope ); } @@ -188,7 +188,7 @@ struct init_fn smbios_init_fn __init_fn ( INIT_NORMAL ) = { }; /** UUID setting obtained via SMBIOS */ -struct setting uuid_setting __setting ( SETTING_HOST ) = { +const struct setting uuid_setting __setting ( SETTING_HOST ) = { .name = "uuid", .description = "UUID", .tag = SMBIOS_RAW_TAG ( SMBIOS_TYPE_SYSTEM_INFORMATION, @@ -198,7 +198,7 @@ struct setting uuid_setting __setting ( SETTING_HOST ) = { }; /** Other SMBIOS predefined settings */ -struct setting smbios_predefined_settings[] __setting ( SETTING_HOST_EXTRA ) = { +const struct setting smbios_predefined_settings[] __setting ( SETTING_HOST_EXTRA ) = { { .name = "manufacturer", .description = "Manufacturer", -- cgit v1.2.3-55-g7522