All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>
Subject: [PATCH v4 1/5] command: Use a constant pointer for the help
Date: Sun, 19 Sep 2021 15:49:32 -0600	[thread overview]
Message-ID: <20210919214937.3829422-2-sjg@chromium.org> (raw)
In-Reply-To: <20210919214937.3829422-1-sjg@chromium.org>

This text should never change during execution, so it makes sense to
use a const char * so that it can be declared as const in the code.
Update struct cmd_tbl with a const char * pointer for 'help'.

We cannot make usage const because of the bmode command, used on mx53ppd
for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v2)

Changes in v2:
- Explain why 'usage' cannot be const

 include/command.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/command.h b/include/command.h
index 137cfbc3231..f8e07a591c6 100644
--- a/include/command.h
+++ b/include/command.h
@@ -45,7 +45,7 @@ struct cmd_tbl {
 			       char *const argv[]);
 	char		*usage;		/* Usage message	(short)	*/
 #ifdef	CONFIG_SYS_LONGHELP
-	char		*help;		/* Help  message	(long)	*/
+	const char	*help;		/* Help  message	(long)	*/
 #endif
 #ifdef CONFIG_AUTO_COMPLETE
 	/* do auto completion on the arguments */
-- 
2.33.0.464.g1972c5931b-goog


  reply	other threads:[~2021-09-19 21:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 21:49 [PATCH v4 0/5] sf: Add documentation and an 'sf mmap' command Simon Glass
2021-09-19 21:49 ` Simon Glass [this message]
2021-10-08 12:40   ` [PATCH v4 1/5] command: Use a constant pointer for the help Jagan Teki
2021-11-13 11:13   ` Heinrich Schuchardt
2021-11-24 17:47   ` Simon Glass
2021-11-24 17:47   ` Simon Glass
2021-09-19 21:49 ` [PATCH v4 2/5] sf: Use const for the stage name Simon Glass
2021-10-08 12:41   ` Jagan Teki
2021-11-13 11:15   ` Heinrich Schuchardt
2021-11-24 17:47   ` Simon Glass
2021-11-24 17:47   ` Simon Glass
2021-09-19 21:49 ` [PATCH v4 3/5] sf: Tidy up code to avoid #ifdef Simon Glass
2021-09-20 11:08   ` Pratyush Yadav
2021-09-24  2:48     ` Simon Glass
2021-10-08 12:41   ` Jagan Teki
2021-11-24 17:47   ` Simon Glass
2021-11-24 17:47   ` Simon Glass
2021-09-19 21:49 ` [PATCH v4 4/5] sf: doc: Add documentation for the 'sf' command Simon Glass
2021-10-08 12:42   ` Jagan Teki
2021-11-13 11:34   ` Heinrich Schuchardt
2021-11-13 14:21     ` Simon Glass
2021-11-13 15:26       ` Heinrich Schuchardt
2021-11-13 18:14         ` Simon Glass
2021-11-24 17:47         ` Simon Glass
2021-11-24 17:47         ` Simon Glass
2021-09-19 21:49 ` [PATCH v4 5/5] sf: Provide a command to access memory-mapped SPI Simon Glass
2021-10-08 12:47   ` Jagan Teki
2021-10-08 20:29     ` Simon Glass
2021-11-13 11:47   ` Heinrich Schuchardt
2021-11-25  0:12     ` Simon Glass
2021-11-13  3:17 ` [PATCH v4 0/5] sf: Add documentation and an 'sf mmap' command Simon Glass

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=20210919214937.3829422-2-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=jagan@amarulasolutions.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.