drivers/option/cfr: Remove old sm_object from constructor
There is no reason I can think to also pass the old object into the constructor considering that the new objects contains the exact same contents during that call (it's copied over a few lines above). Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: Idd5b34134b6064c19266448b551248eb29e097fe Reviewed-on: https://review.coreboot.org/c/coreboot/+/89957 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
b535db8f1e
commit
04778ddd38
8 changed files with 15 additions and 17 deletions
|
|
@ -78,7 +78,7 @@ coreboot table.
|
|||
EMI eeprom.
|
||||
|
||||
```
|
||||
static void update_serial(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_serial(struct sm_object *new)
|
||||
{
|
||||
new->sm_varchar.default_value = get_emi_eeprom_vpd()->serial_number;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,8 +347,8 @@ static uint32_t sm_write_object(char *current, const struct sm_object *sm_obj)
|
|||
/* Invoke callback to update fields */
|
||||
if (sm_obj->ctor) {
|
||||
memcpy(&sm_obj_copy, sm_obj, sizeof(*sm_obj));
|
||||
sm_obj->ctor(sm_obj, &sm_obj_copy);
|
||||
|
||||
sm_obj->ctor(&sm_obj_copy);
|
||||
assert(sm_obj->kind == sm_obj_copy.kind);
|
||||
sm_obj = (const struct sm_object *)&sm_obj_copy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ struct sm_object {
|
|||
const struct sm_object *dep;
|
||||
const uint32_t *dep_values;
|
||||
const uint32_t num_dep_values;
|
||||
void (*ctor)(const struct sm_object *obj, struct sm_object *new); /* Called on object creation */
|
||||
void (*ctor)(struct sm_object *new); /* Called on object creation */
|
||||
union {
|
||||
struct sm_obj_enum sm_enum;
|
||||
struct sm_obj_number sm_number;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <static.h>
|
||||
|
||||
/* Hide the dGPU CFR entry if dGPU not present */
|
||||
static void update_dgpu(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_dgpu(struct sm_object *new)
|
||||
{
|
||||
struct device *dgpu = DEV_PTR(dgpu);
|
||||
if (!dgpu || !dgpu->enabled) {
|
||||
|
|
|
|||
|
|
@ -12,23 +12,23 @@
|
|||
|
||||
#include "vpd.h"
|
||||
|
||||
static void update_rt_perf(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_rt_perf(struct sm_object *new)
|
||||
{
|
||||
const bool rt_perf = get_emi_eeprom_vpd()->profile == ATLAS_PROF_REALTIME_PERFORMANCE;
|
||||
|
||||
if (!rt_perf)
|
||||
return;
|
||||
|
||||
if (obj->kind == SM_OBJ_BOOL) {
|
||||
if (new->kind == SM_OBJ_BOOL) {
|
||||
new->sm_bool.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
new->sm_bool.default_value = false;
|
||||
} else if (obj->kind == SM_OBJ_ENUM) {
|
||||
} else if (new->kind == SM_OBJ_ENUM) {
|
||||
new->sm_enum.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
new->sm_enum.default_value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void update_bad_profile(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_bad_profile(struct sm_object *new)
|
||||
{
|
||||
const bool pf_ok = get_emi_eeprom_vpd()->profile != 0;
|
||||
|
||||
|
|
@ -37,17 +37,17 @@ static void update_bad_profile(const struct sm_object *obj, struct sm_object *ne
|
|||
new->sm_comment.flags |= CFR_OPTFLAG_SUPPRESS;
|
||||
}
|
||||
|
||||
static void update_serial(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_serial(struct sm_object *new)
|
||||
{
|
||||
new->sm_varchar.default_value = get_emi_eeprom_vpd()->serial_number;
|
||||
}
|
||||
|
||||
static void update_part_number(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_part_number(struct sm_object *new)
|
||||
{
|
||||
new->sm_varchar.default_value = get_emi_eeprom_vpd()->part_number;
|
||||
}
|
||||
|
||||
static void update_profile(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_profile(struct sm_object *new)
|
||||
{
|
||||
new->sm_number.default_value = get_emi_eeprom_vpd()->profile;
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ static struct sm_enum_value pch_pm_pcie_pll_ssc_values[] = {
|
|||
SM_ENUM_VALUE_END,
|
||||
};
|
||||
|
||||
static void update_pll_ssc_values(const struct sm_object *obj, struct sm_object *new)
|
||||
static void update_pll_ssc_values(struct sm_object *new)
|
||||
{
|
||||
for (size_t i = 0; i < NUM_PCIE_SSC_SETTINGS; i++) {
|
||||
char buffer[16];
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
void __weak cfr_card_reader_update(const struct sm_object *obj,
|
||||
struct sm_object *new_obj)
|
||||
void __weak cfr_card_reader_update(struct sm_object *new_obj)
|
||||
{
|
||||
(void)obj;
|
||||
(void)new_obj;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
void cfr_card_reader_update(const struct sm_object *obj, struct sm_object *new_obj);
|
||||
void cfr_card_reader_update(struct sm_object *new_obj);
|
||||
|
||||
static const struct sm_object accelerometer = SM_DECLARE_BOOL({
|
||||
.opt_name = "accelerometer",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <variants.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
void cfr_card_reader_update(const struct sm_object *obj, struct sm_object *new_obj)
|
||||
void cfr_card_reader_update(struct sm_object *new_obj)
|
||||
{
|
||||
struct device *mxc_accel = DEV_PTR(mxc6655);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue