All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Simon Glass <sjg@chromium.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 Ovidiu Panait <ovidiu.panait@windriver.com>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Subject: Re: [PATCH v1 2/2] image: Explicitly declare do_bdinfo()
Date: Mon, 8 Nov 2021 10:37:41 +0200	[thread overview]
Message-ID: <CAHp75Vc_arxWaD_WYp4GnLiB1LX1BE8QoTQLNxfcBqDGc1_DvA@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ2u3W_wXL61U4KWTLqij=+ze2_bn5Sdf71wxBdS7xkAVA@mail.gmail.com>

On Sun, Nov 7, 2021 at 6:43 PM Simon Glass <sjg@chromium.org> wrote:
> On Sat, 6 Nov 2021 at 01:59, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Saturday, November 6, 2021, Simon Glass <sjg@chromium.org> wrote:
> >> On Fri, 5 Nov 2021 at 14:10, Andy Shevchenko
> >> <andriy.shevchenko@linux.intel.com> wrote:
> >> >
> >> > Compiler is not happy:
> >> >
> >> > common/image-board.c: In function ‘boot_get_kbd’:
> >> > common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration]
> >> >   902 |                 do_bdinfo(NULL, 0, 0, NULL);
> >> >       |                 ^~~~~~~~~
> >> >
> >> > Move the forward declaration to a header.
> >> >
> >> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >> > ---
> >> >  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 <linux/errno.h>
> >> >  #include <asm/io.h>
> >> >
> >> > -#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, unsigned 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 warning.
>
> I mean drop the #if line and the #endif line.

And we will have a dangling prototype when !CONFIG_CMD_BDI ?
Is it okay?

>  We try to avoid this
> sort that things like IS_ENABLED() work.
--
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-11-08  8:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 20:09 [PATCH v1 1/2] image: Fix typo in boot_get_kbd() Andy Shevchenko
2021-11-05 20:09 ` [PATCH v1 2/2] image: Explicitly declare do_bdinfo() Andy Shevchenko
2021-11-06  3:16   ` Simon Glass
2021-11-06  7:58     ` Andy Shevchenko
2021-11-07 16:43       ` Simon Glass
2021-11-08  8:37         ` Andy Shevchenko [this message]
2021-11-08 15:58           ` Simon Glass
2021-11-06  3:16 ` [PATCH v1 1/2] image: Fix typo in boot_get_kbd() Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75Vc_arxWaD_WYp4GnLiB1LX1BE8QoTQLNxfcBqDGc1_DvA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ovidiu.panait@windriver.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.