From mboxrd@z Thu Jan 1 00:00:00 1970 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=-19.4 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, 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 F4178C4338F for ; Sun, 1 Aug 2021 18:03:15 +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 06B4C61075 for ; Sun, 1 Aug 2021 18:03:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 06B4C61075 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 C3BAE831ED; Sun, 1 Aug 2021 20:02:59 +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="BFCOMO6C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36D4183183; Sun, 1 Aug 2021 20:02:55 +0200 (CEST) Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (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 98961829C7 for ; Sun, 1 Aug 2021 20:02:51 +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-x334.google.com with SMTP id c2-20020a0568303482b029048bcf4c6bd9so15371929otu.8 for ; Sun, 01 Aug 2021 11:02: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=g8zKjaTPqpPaT11sdQXIAiKPNjhdbH5CcYOY3gO+QUo=; b=BFCOMO6CBgq8Os+numk2g9Gw1+vjHGWkWfpBz1TD81ZxS69QyUAhgpJ7/1RwTXdICL yCAIcxmpf2OOK6H0y7vnndDYhyeYXLbJaya1T61ZSTycf1wEngk3Mrr1523NMUBAIS41 8uGKZNvHmzh61oFOV84BWRghwB1JTCTbtExhw= 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=g8zKjaTPqpPaT11sdQXIAiKPNjhdbH5CcYOY3gO+QUo=; b=LwNCmbgXUFGKAMg7jTva1OTeBJtST8hgRxF/wg23ZQhGNN/iYH7ZZEk2mhUG7EsrXJ p/lw+e5WdFsBZOOeLA7zLgx4vTeQcRb1J9VngddSxWFpGf5fAq4SoMEovceF1/aQ091p /urtV1cftIUK/9vm8EuJFurV4xsDYwqbd3Sp8o3Tdx4pdwa1Dh8ZtC6J86AI87gGvYbj 1mOOgqCS040F3yGE4nbzflOxatz1KRR54QR3GDV6K3KoDDsuHTQO6pz9io5r+Mdwi65V 5/HRBBf8IujtqNpyQFtEa0HN2UGkuFpCbZuLVOMDoilQ7S2YrF5958H166wDj1+hkPIG 3o0g== X-Gm-Message-State: AOAM532WeZXbHbl222AJMA6SO9f+pzEBMoDDLGLStnociyTLdZNzS1gB p6XTotoVdCJjv3Y5jJlwGi0JV4eYDq1nGi8N X-Google-Smtp-Source: ABdhPJwlMqplb6JM3tsUOKe71iuvi7y5UJ8BYfWwPj+35OEYMpqgW0sR3Ct/BTeA/sptIhX9NiRoXw== X-Received: by 2002:a9d:6d83:: with SMTP id x3mr8740619otp.110.1627840969729; Sun, 01 Aug 2021 11:02:49 -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 s184sm1386744oig.25.2021.08.01.11.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 11:02:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Jagan Teki , Simon Glass , Bin Meng , Kory Maincent Subject: [PATCH v2 1/4] command: Use a constant pointer for the help Date: Sun, 1 Aug 2021 12:02:40 -0600 Message-Id: <20210801180243.2166525-2-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210801180243.2166525-1-sjg@chromium.org> References: <20210801180243.2166525-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 --- 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.32.0.554.ge1b32706d8-goog