From patchwork Sun Aug 1 21:12:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1512152 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CZvarFBQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GdDPb3qSjz9sT6 for ; Mon, 2 Aug 2021 07:13:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2C619832EC; Sun, 1 Aug 2021 23:12:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CZvarFBQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 40555832EC; Sun, 1 Aug 2021 23:12:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1155A831BD for ; Sun, 1 Aug 2021 23:12:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x332.google.com with SMTP id a5-20020a05683012c5b029036edcf8f9a6so15716888otq.3 for ; Sun, 01 Aug 2021 14:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XK4DRJDG1WEr1345nqvDlQzSodE4+QDphQKigFD3qg4=; b=CZvarFBQBxxpNVKL+XlEMMV06nolEYoYCo2OAG4wX3FjmC2uN+4l2pdX8DIXnUGZCC 1Jd5j7DnSe2YHQlS7aPiWeElsS7fewXj2iKrsf62cO9jWPfsW0341yXc/bKyf99ruYGR Mbfzlh7kd3VJt+t2z+o0u4qBX3C54GfUjVrh4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XK4DRJDG1WEr1345nqvDlQzSodE4+QDphQKigFD3qg4=; b=tkzNK67gs60z7kZIrntX9a47/7RylHoubsf53pJMhuorP2P6pY9i0YlrnudWl3TxY4 9S+KT1uqs0SEwSwGMO0OohAxApQoiB4CJPeGT54sQSGCuGJT+8O5025onJr0L2CQllmE PYUSE0Y4QFxz9lH3/5POKHxijSDWyu0CmUMZpFMhKKsJGAQ66oXPvBsBZ98Sw/poido3 7R4kwSQ9H3gMW5yip/CutMTzWdobbIht3Vg1Ty5/TZkYx7Pv2+5MnjeqBN14DwWWF9Vz CboyZM4BJHWboZ36+8pcWeBoxwU9zsnPOcf/PaAgNacxtuHLSn2PvC/9+Ax2wPyycDjk lSXQ== X-Gm-Message-State: AOAM533j70q3D/+okf3l5Ada5BT2tZZtNP+P/M00w34GAtNjXo09/deq 7pmC9HftS+hVySbmBx/as2nkH6mIT7umJwFB X-Google-Smtp-Source: ABdhPJwtx13gUczF3uBgOZiHuuTl5eAOZQe+tBlRPq29/Gm4P04/KgR/OgO8H5cyt48Gk1AZC9FoBA== X-Received: by 2002:a9d:84c:: with SMTP id 70mr9593905oty.165.1627852370283; Sun, 01 Aug 2021 14:12:50 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id i188sm1446105oih.7.2021.08.01.14.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 14:12:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Jagan Teki , Simon Glass Subject: [PATCH v3 1/4] command: Use a constant pointer for the help Date: Sun, 1 Aug 2021 15:12:42 -0600 Message-Id: <20210801211245.2208037-2-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210801211245.2208037-1-sjg@chromium.org> References: <20210801211245.2208037-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- (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 */