From patchwork Sun Sep 19 21:49:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1529892 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org 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=laZA+O8w; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4HCLvj64P2z9sX3 for ; Mon, 20 Sep 2021 07:50:09 +1000 (AEST) 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 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 Reviewed-by: Jagan Teki Reviewed-by: Heinrich Schuchardt Reviewed-by: Heinrich Schuchardt Reviewed-by: Heinrich Schuchardt --- (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 */