Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D948C433EF for ; Sun, 19 Sep 2021 21:50:08 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9751660F9B for ; Sun, 19 Sep 2021 21:50:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9751660F9B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5712182DA1; Sun, 19 Sep 2021 23:49:53 +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="laZA+O8w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CAA4480202; Sun, 19 Sep 2021 23:49:46 +0200 (CEST) Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) (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 39DD48048A for ; Sun, 19 Sep 2021 23:49:43 +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-oo1-xc2c.google.com with SMTP id t2-20020a4ae9a2000000b0028c7144f106so5210024ood.6 for ; Sun, 19 Sep 2021 14:49:43 -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=Pt0hv6rnD5HMINaAQCTNMeChp7BdZx4LQ22bGBmsNeI=; b=laZA+O8w5Ah9nj9aWjYqBzM+J7w6pwvb/NyXij5Brlj34sfZvIQdfisx46onuPtSMB 8RSbqAEezXR/00UP7HnaW5g/G6XA2Q9uM3FNA63yzf9G/+tSsxpT+/WyHrOuvjgOkRoC Lo9iqGacIwqGOwrumSzN5Afdh+mraaJnvq+/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pt0hv6rnD5HMINaAQCTNMeChp7BdZx4LQ22bGBmsNeI=; b=Px4W9k9wooKzDJDBzc9lGdFuWlRkHPXhJyLHcV8oFH39cXjYRjwNV31OtUY7IN2Ira yerPH7rBf7XQNphUCTXYxSjk/6y5u+DCND4N+seNl3vpaoaSHfCS2O/uICeZGMjWbUB+ B+5Tc1rLE9Hmk9Pl3nATf1LfTEqIxfazBwIK1TKQtOYcK4Bq+te4Ap8BaPdoVUebEfox BJfi9UMKKVOU0JOiffkhGLBgZUQko0J3CDfCLEZFjWRv0DCm7mLHokjdy+FHhAojM6eT xttYnu6DkzFTQCyC0fFycR6yWOufjw5pmT0KGuudHr/eJyigffgytkWpkhe4L3Br8sIz CoQw== X-Gm-Message-State: AOAM5326fdBXZvFurwYeonE6wStPdYjRn+/Dxc7AaYG0tEZjtvV31Ff/ xmov3Wi8inFNx7WXq2MbvTz1bPR6vPr1DA== X-Google-Smtp-Source: ABdhPJz04J7SKzSzl/UVatwZvC9irhHap847AbVvB7CBhIpyrRiT/oyj68xhldH3zzIYKZV7BcEElA== X-Received: by 2002:a4a:e9e4:: with SMTP id w4mr9324858ooc.13.1632088181674; Sun, 19 Sep 2021 14:49:41 -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 q25sm519897oof.33.2021.09.19.14.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 14:49:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Jagan Teki , Heinrich Schuchardt , Simon Glass Subject: [PATCH v4 1/5] command: Use a constant pointer for the help Date: Sun, 19 Sep 2021 15:49:32 -0600 Message-Id: <20210919214937.3829422-2-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog In-Reply-To: <20210919214937.3829422-1-sjg@chromium.org> References: <20210919214937.3829422-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 */ -- 2.33.0.464.g1972c5931b-goog