All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
To: u-boot@lists.denx.de
Subject: [RESEND 3/7] cmd: bcb: Extract '__bcb_store' from 'do_bcb_store' for internal needs
Date: Fri, 23 Oct 2020 11:52:21 +0300	[thread overview]
Message-ID: <ac779ed3e749c8cf720d4a2a3398a0e8349f85c0.1603442753.git.roman.kovalivskyi@globallogic.com> (raw)
In-Reply-To: <cover.1603442753.git.roman.kovalivskyi@globallogic.com>

From: Eugeniu Rosca <erosca@de.adit-jv.com>

Enriching the functionality of U-Boot 'bcb' may assume using the
existing sub-commands as building blocks for the next ones.

A clean way to achive the above is to expose a number of static
routines, each mapped to an existing user command (e.g. load/set/store),
with a user/caller-friendly prototype (i.e. do not force the caller
to wrap an integer into a string).

This third patch makes '__bcb_store' available for internal needs.

No functional change intended.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
---
 cmd/bcb.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/cmd/bcb.c b/cmd/bcb.c
index 113f04ffe6b2..b9cd20ea3d56 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -270,8 +270,7 @@ static int do_bcb_dump(struct cmd_tbl *cmdtp, int flag, int argc,
 	return CMD_RET_SUCCESS;
 }
 
-static int do_bcb_store(struct cmd_tbl *cmdtp, int flag, int argc,
-			char *const argv[])
+static int __bcb_store(void)
 {
 	struct blk_desc *desc;
 	struct disk_partition info;
@@ -302,6 +301,12 @@ err:
 	return CMD_RET_FAILURE;
 }
 
+static int do_bcb_store(struct cmd_tbl *cmdtp, int flag, int argc,
+			char * const argv[])
+{
+	return __bcb_store();
+}
+
 static struct cmd_tbl cmd_bcb_sub[] = {
 	U_BOOT_CMD_MKENT(load, CONFIG_SYS_MAXARGS, 1, do_bcb_load, "", ""),
 	U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 1, do_bcb_set, "", ""),
-- 
2.17.1

  parent reply	other threads:[~2020-10-23  8:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  8:52 [RESEND 0/7] Refactor generic fastboot_set_reboot_flag implementation Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 1/7] cmd: bcb: Extract '__bcb_load' from 'do_bcb_load' for internal needs Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 2/7] cmd: bcb: Extract '__bcb_set' from 'do_bcb_set' " Roman Kovalivskyi
2020-10-23  8:52 ` Roman Kovalivskyi [this message]
2020-10-23  8:52 ` [RESEND 4/7] cmd: bcb: Expose 'bcb_write_reboot_reason' to external callers Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 5/7] cmd: bcb: Add support for processing const string literals in bcb_set() Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 6/7] Revert "fastboot: Add default fastboot_set_reboot_flag implementation" Roman Kovalivskyi
2021-01-23 15:08   ` Lukasz Majewski
2021-01-25 17:16     ` Roman Kovalivskyi
2021-01-25 18:10       ` Tom Rini
2021-01-25 18:33       ` Marek Vasut
2020-10-23  8:52 ` [RESEND 7/7] fastboot: Implement generic fastboot_set_reboot_flag Roman Kovalivskyi
2021-01-23 15:11   ` Lukasz Majewski
2020-12-10  7:30 ` [RESEND 0/7] Refactor generic fastboot_set_reboot_flag implementation Eugeniu Rosca
2020-12-10 16:54   ` Tom Rini
2021-01-22  9:08     ` Eugeniu Rosca

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=ac779ed3e749c8cf720d4a2a3398a0e8349f85c0.1603442753.git.roman.kovalivskyi@globallogic.com \
    --to=roman.kovalivskyi@globallogic.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.