mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: oss-tools@pengutronix.de
Cc: mfe@pengutronix.de
Subject: [OSS-Tools] [PATCH dt-utils 06/14] state: remove param member from state_uint32, state_enum32, state_mac
Date: Fri, 14 Oct 2022 18:41:56 +0200	[thread overview]
Message-ID: <20221014164204.3812506-7-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20221014164204.3812506-1-m.felsch@pengutronix.de>

This ports the following barebox commit

| commit 8718fd1f0508ed694569df212333fff9a22b5303
| Author: Christian Eggers <ceggers@arri.de>
| 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 <ceggers@arri.de>
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 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




  parent reply	other threads:[~2022-10-14 16:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 16:41 [OSS-Tools] [PATCH dt-utils 00/14] Sync Barebox-State code base Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 01/14] state: Remove duplicate incudes Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 02/14] state: backend_raw: fix ignoring unpack failures Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 03/14] state: backend_storage: deal gracefully with runtime bucket corruption Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 04/14] state: treat state with all-invalid buckets as dirty Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 05/14] state: remove param member from struct state_string Marco Felsch
2022-10-14 16:41 ` Marco Felsch [this message]
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 07/14] state: remove unused function Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 08/14] state: propagate failure to fixup enum32 into DT Marco Felsch
2022-10-14 16:41 ` [OSS-Tools] [PATCH dt-utils 09/14] state: add SPDX-License-Identifier for files without explicit license Marco Felsch
2022-10-14 16:42 ` [OSS-Tools] [PATCH dt-utils 10/14] state: fix typos found with codespell Marco Felsch
2022-10-14 16:42 ` [OSS-Tools] [PATCH dt-utils 11/14] common: xstrdup: don't panic on xstrdup(NULL) Marco Felsch
2022-10-14 16:42 ` [OSS-Tools] [PATCH dt-utils 12/14] libdt: add of_property_write_strings support Marco Felsch
2022-10-14 16:42 ` [OSS-Tools] [PATCH dt-utils 13/14] libdt: add partition search function Marco Felsch
2022-10-14 16:42 ` [OSS-Tools] [PATCH dt-utils 14/14] state: sync with barebox to support new backend type Marco Felsch
2022-10-21  7:37 ` [OSS-Tools] [PATCH dt-utils 00/14] Sync Barebox-State code base Marco Felsch
2023-06-05 13:12 ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221014164204.3812506-7-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=mfe@pengutronix.de \
    --cc=oss-tools@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox