From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 14 Oct 2022 18:42:23 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ojNlQ-008iH5-Dr for lore@lore.pengutronix.de; Fri, 14 Oct 2022 18:42:23 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ojNlE-0006Q5-FJ; Fri, 14 Oct 2022 18:42:12 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojNlB-0006Fd-Cs; Fri, 14 Oct 2022 18:42:09 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1ojNlA-001WTq-Mk; Fri, 14 Oct 2022 18:42:08 +0200 Received: from mfe by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1ojNl8-00FzpU-NQ; Fri, 14 Oct 2022 18:42:06 +0200 From: Marco Felsch To: oss-tools@pengutronix.de Date: Fri, 14 Oct 2022 18:41:56 +0200 Message-Id: <20221014164204.3812506-7-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221014164204.3812506-1-m.felsch@pengutronix.de> References: <20221014164204.3812506-1-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [OSS-Tools] [PATCH dt-utils 06/14] state: remove param member from state_uint32, state_enum32, state_mac X-BeenThere: oss-tools@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mfe@pengutronix.de Sender: "OSS-Tools" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: oss-tools-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false This ports the following barebox commit | commit 8718fd1f0508ed694569df212333fff9a22b5303 | Author: Christian Eggers | Date: Thu Jan 23 13:20:43 2020 +0100 | | state: remove param member from state_uint32, state_enum32, state_mac | | After adding the parameter, the pointer isn't required anymore. | | Signed-off-by: Christian Eggers | Signed-off-by: Sascha Hauer Signed-off-by: Marco Felsch --- src/barebox-state/state.h | 3 --- src/barebox-state/state_variables.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/barebox-state/state.h b/src/barebox-state/state.h index 40450fe..1881d92 100644 --- a/src/barebox-state/state.h +++ b/src/barebox-state/state.h @@ -159,7 +159,6 @@ struct state_variable { */ struct state_uint32 { struct state_variable var; - struct param_d *param; uint32_t value; uint32_t value_default; }; @@ -169,7 +168,6 @@ struct state_uint32 { */ struct state_enum32 { struct state_variable var; - struct param_d *param; uint32_t value; uint32_t value_default; const char **names; @@ -181,7 +179,6 @@ struct state_enum32 { */ struct state_mac { struct state_variable var; - struct param_d *param; uint8_t value[6]; uint8_t value_default[6]; }; diff --git a/src/barebox-state/state_variables.c b/src/barebox-state/state_variables.c index 18d9884..228a822 100644 --- a/src/barebox-state/state_variables.c +++ b/src/barebox-state/state_variables.c @@ -116,7 +116,6 @@ static struct state_variable *state_uint8_create(struct state *state, return ERR_CAST(param); } - su32->param = param; su32->var.type = vtype; su32->var.size = sizeof(uint8_t); #ifdef __LITTLE_ENDIAN @@ -146,7 +145,6 @@ static struct state_variable *state_uint32_create(struct state *state, return ERR_CAST(param); } - su32->param = param; su32->var.type = vtype; su32->var.size = sizeof(uint32_t); su32->var.raw = &su32->value; @@ -226,6 +224,7 @@ static struct state_variable *state_enum32_create(struct state *state, const struct variable_type *vtype) { struct state_enum32 *enum32; + struct param_d *param; int ret, i, num_names; enum32 = xzalloc(sizeof(*enum32)); @@ -253,11 +252,11 @@ static struct state_variable *state_enum32_create(struct state *state, enum32->names[i] = xstrdup(name); } - enum32->param = dev_add_param_enum(&state->dev, name, state_set_dirty, + param = dev_add_param_enum(&state->dev, name, state_set_dirty, NULL, &enum32->value, enum32->names, num_names, &enum32->var); - if (IS_ERR(enum32->param)) { - ret = PTR_ERR(enum32->param); + if (IS_ERR(param)) { + ret = PTR_ERR(param); goto out; } @@ -310,6 +309,7 @@ static struct state_variable *state_mac_create(struct state *state, const struct variable_type *vtype) { struct state_mac *mac; + struct param_d *param; int ret; mac = xzalloc(sizeof(*mac)); @@ -319,10 +319,10 @@ static struct state_variable *state_mac_create(struct state *state, mac->var.raw = mac->value; mac->var.state = state; - mac->param = dev_add_param_mac(&state->dev, name, state_set_dirty, + param = dev_add_param_mac(&state->dev, name, state_set_dirty, NULL, mac->value, &mac->var); - if (IS_ERR(mac->param)) { - ret = PTR_ERR(mac->param); + if (IS_ERR(param)) { + ret = PTR_ERR(param); goto out; } -- 2.30.2