* [PATCH v1 1/1] cmd: nvedit: Mark a few functions static
@ 2024-10-21 13:56 Andy Shevchenko
2024-10-21 16:32 ` Simon Glass
2024-10-24 20:42 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2024-10-21 13:56 UTC (permalink / raw)
To: Tom Rini, u-boot; +Cc: Andy Shevchenko
Some functions are not used anywhere except the same file
where they are defined. Mark them static. This helps avoiding
the compiler warnings:
cmd/nvedit.c:201:5: warning: no previous prototype for ‘do_env_ask’ [-Wmissing-prototypes]
cmd/nvedit.c:315:5: warning: no previous prototype for ‘do_env_callback’ [-Wmissing-prototypes]
cmd/nvedit.c:384:5: warning: no previous prototype for ‘do_env_flags’ [-Wmissing-prototype ]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
cmd/nvedit.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 98a687bcabbd..0bd4799dc5a2 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -198,7 +198,7 @@ static int do_env_set(struct cmd_tbl *cmdtp, int flag, int argc,
* Prompt for environment variable
*/
#if defined(CONFIG_CMD_ASKENV)
-int do_env_ask(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
+static int do_env_ask(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char message[CONFIG_SYS_CBSIZE];
int i, len, pos, size;
@@ -312,8 +312,8 @@ static int print_active_callback(struct env_entry *entry)
/*
* Print the callbacks available and what they are bound to
*/
-int do_env_callback(struct cmd_tbl *cmdtp, int flag, int argc,
- char *const argv[])
+static int do_env_callback(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct env_clbk_tbl *clbkp;
int i;
@@ -381,7 +381,7 @@ static int print_active_flags(struct env_entry *entry)
/*
* Print the flags available and what variables have flags
*/
-int do_env_flags(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
+static int do_env_flags(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
/* Print the available variable types */
printf("Available variable type flags (position %d):\n",
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] cmd: nvedit: Mark a few functions static
2024-10-21 13:56 [PATCH v1 1/1] cmd: nvedit: Mark a few functions static Andy Shevchenko
@ 2024-10-21 16:32 ` Simon Glass
2024-10-24 20:42 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2024-10-21 16:32 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Tom Rini, u-boot
On Mon, 21 Oct 2024 at 15:56, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Some functions are not used anywhere except the same file
> where they are defined. Mark them static. This helps avoiding
> the compiler warnings:
>
> cmd/nvedit.c:201:5: warning: no previous prototype for ‘do_env_ask’ [-Wmissing-prototypes]
> cmd/nvedit.c:315:5: warning: no previous prototype for ‘do_env_callback’ [-Wmissing-prototypes]
> cmd/nvedit.c:384:5: warning: no previous prototype for ‘do_env_flags’ [-Wmissing-prototype ]
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> cmd/nvedit.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
> diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> index 98a687bcabbd..0bd4799dc5a2 100644
> --- a/cmd/nvedit.c
> +++ b/cmd/nvedit.c
> @@ -198,7 +198,7 @@ static int do_env_set(struct cmd_tbl *cmdtp, int flag, int argc,
> * Prompt for environment variable
> */
> #if defined(CONFIG_CMD_ASKENV)
> -int do_env_ask(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
> +static int do_env_ask(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
> {
> char message[CONFIG_SYS_CBSIZE];
> int i, len, pos, size;
> @@ -312,8 +312,8 @@ static int print_active_callback(struct env_entry *entry)
> /*
> * Print the callbacks available and what they are bound to
> */
> -int do_env_callback(struct cmd_tbl *cmdtp, int flag, int argc,
> - char *const argv[])
> +static int do_env_callback(struct cmd_tbl *cmdtp, int flag, int argc,
> + char *const argv[])
> {
> struct env_clbk_tbl *clbkp;
> int i;
> @@ -381,7 +381,7 @@ static int print_active_flags(struct env_entry *entry)
> /*
> * Print the flags available and what variables have flags
> */
> -int do_env_flags(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
> +static int do_env_flags(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
> {
> /* Print the available variable types */
> printf("Available variable type flags (position %d):\n",
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] cmd: nvedit: Mark a few functions static
2024-10-21 13:56 [PATCH v1 1/1] cmd: nvedit: Mark a few functions static Andy Shevchenko
2024-10-21 16:32 ` Simon Glass
@ 2024-10-24 20:42 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2024-10-24 20:42 UTC (permalink / raw)
To: u-boot, Andy Shevchenko
On Mon, 21 Oct 2024 16:56:33 +0300, Andy Shevchenko wrote:
> Some functions are not used anywhere except the same file
> where they are defined. Mark them static. This helps avoiding
> the compiler warnings:
>
> cmd/nvedit.c:201:5: warning: no previous prototype for ‘do_env_ask’ [-Wmissing-prototypes]
> cmd/nvedit.c:315:5: warning: no previous prototype for ‘do_env_callback’ [-Wmissing-prototypes]
> cmd/nvedit.c:384:5: warning: no previous prototype for ‘do_env_flags’ [-Wmissing-prototype ]
>
> [...]
Applied to u-boot/master, thanks!
--
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-24 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 13:56 [PATCH v1 1/1] cmd: nvedit: Mark a few functions static Andy Shevchenko
2024-10-21 16:32 ` Simon Glass
2024-10-24 20:42 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox