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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464FFC433EF for ; Mon, 8 Nov 2021 15:58:56 +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 9A8A561186 for ; Mon, 8 Nov 2021 15:58:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9A8A561186 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 E2B458389F; Mon, 8 Nov 2021 16:58:53 +0100 (CET) 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="Gh9QHAwN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 31ABF83885; Mon, 8 Nov 2021 16:58:49 +0100 (CET) Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) (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 AC6D78386E for ; Mon, 8 Nov 2021 16:58:43 +0100 (CET) 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@google.com Received: by mail-vk1-xa35.google.com with SMTP id n201so8463883vkn.12 for ; Mon, 08 Nov 2021 07:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xUHzJV/zdzFyzOpOAUsMN04TY4flArUCJAfGIkTmOD4=; b=Gh9QHAwNRV9C6zUAOlRQ3QZOOuvZ7pe6A9Q8YeU+uNeCDJawvxEqq4bZqN00OAPVnN u86uY6p041Su8EVnJXOadT6/klN2L2qI0NUTuE0ijxnpSzb+2k3vPiboTOk6y6RhM1ER G5v1DITsIB2a1WpDPQcUX4lHJ5GhBtqvIR+ZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xUHzJV/zdzFyzOpOAUsMN04TY4flArUCJAfGIkTmOD4=; b=GdOLOiRo6eb05WV/z8mraBq72wjQMzH/6qtGHQrh2iTBaagnTg92gzYL9CqEErr/CQ Ur6Z7VVmwabzknPcI8N1aSMmZRL6k4J0d27SRFU1ZOpgH/oaOJQTkVhEoN4rUENrqgTN AZrp/50mIXzcTptDvAKbA/r/kCC99NOs+zRPkwlFMvC1p5iv+QSKjM1/CEUNEoHuKPGh WsT8YDaqIL0Scx0Hs65GFLvren7rE5qXpV4+nEEIC7lDFdUNOx6aLLADvIziiS6Dav2n 6La98aLme1BYB/j8ls883EflG0Nfsq+kdQYoQfrcXaaZq7BAIfyO3ERxL8/OjUEgqAxh p6Sw== X-Gm-Message-State: AOAM530GBcfCcLuE4BXps9r4SSjktqHE4KYNQEypggxK3JhRFTPm/745 0oa9ClI4CHK6gtwoirZrS5lOAQ7XeTAqn59UJaeTTrGVeJ8= X-Google-Smtp-Source: ABdhPJw5sPgqw95lWXYybm1OUoBl+lEteMKdSP5r+5KfgsFudNRSXcO7c6DAOkj3dRjJpp1PDw0EOpEfqWgW9R+Wv0M= X-Received: by 2002:a05:6122:548:: with SMTP id y8mr14386746vko.24.1636387122257; Mon, 08 Nov 2021 07:58:42 -0800 (PST) MIME-Version: 1.0 References: <20211105200952.47866-1-andriy.shevchenko@linux.intel.com> <20211105200952.47866-2-andriy.shevchenko@linux.intel.com> In-Reply-To: From: Simon Glass Date: Mon, 8 Nov 2021 08:58:30 -0700 Message-ID: Subject: Re: [PATCH v1 2/2] image: Explicitly declare do_bdinfo() To: Andy Shevchenko Cc: Andy Shevchenko , Ovidiu Panait , "u-boot@lists.denx.de" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi Andy, On Mon, 8 Nov 2021 at 01:38, Andy Shevchenko wr= ote: > > On Sun, Nov 7, 2021 at 6:43 PM Simon Glass wrote: > > On Sat, 6 Nov 2021 at 01:59, Andy Shevchenko wrote: > > > On Saturday, November 6, 2021, Simon Glass wrote: > > >> On Fri, 5 Nov 2021 at 14:10, Andy Shevchenko > > >> wrote: > > >> > > > >> > Compiler is not happy: > > >> > > > >> > common/image-board.c: In function =E2=80=98boot_get_kbd=E2=80=99: > > >> > common/image-board.c:902:17: warning: implicit declaration of func= tion =E2=80=98do_bdinfo=E2=80=99 [-Wimplicit-function-declaration] > > >> > 902 | do_bdinfo(NULL, 0, 0, NULL); > > >> > | ^~~~~~~~~ > > >> > > > >> > Move the forward declaration to a header. > > >> > > > >> > Signed-off-by: Andy Shevchenko > > >> > --- > > >> > common/image.c | 5 ----- > > >> > include/init.h | 5 +++++ > > >> > 2 files changed, 5 insertions(+), 5 deletions(-) > > >> > > > >> > diff --git a/common/image.c b/common/image.c > > >> > index 3fa60b582796..57bf86278149 100644 > > >> > --- a/common/image.c > > >> > +++ b/common/image.c > > >> > @@ -29,11 +29,6 @@ > > >> > #include > > >> > #include > > >> > > > >> > -#ifdef CONFIG_CMD_BDI > > >> > -extern int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, > > >> > - char *const argv[]); > > >> > -#endif > > >> > - > > >> > DECLARE_GLOBAL_DATA_PTR; > > >> > > > >> > /* Set this if we have less than 4 MB of malloc() space */ > > >> > diff --git a/include/init.h b/include/init.h > > >> > index c781789e367e..37ca9905414f 100644 > > >> > --- a/include/init.h > > >> > +++ b/include/init.h > > >> > @@ -332,6 +332,11 @@ void bdinfo_print_mhz(const char *name, unsig= ned long hz); > > >> > /* Show arch-specific information for the 'bd' command */ > > >> > void arch_print_bdinfo(void); > > >> > > > >> > +#if defined(CONFIG_CMD_BDI) > > >> > +extern int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, > > >> > + char *const argv[]); > > >> > +#endif > > >> > > >> Can we drop the #if..#endif? > > > > > > > > > No, AFAICT, but you can do it later somehow. Currently this fixes a w= arning. > > > > I mean drop the #if line and the #endif line. > > And we will have a dangling prototype when !CONFIG_CMD_BDI ? > Is it okay? Do you mean one that isn't used? Yes that is fine. > > > We try to avoid this > > sort that things like IS_ENABLED() work. Regards, Simon