[PATCH v2 2/6] console: Implement flush() function

Simon Glass sjg at chromium.org
Fri Aug 12 02:08:46 CEST 2022


Hi Pali,

On Thu, 11 Aug 2022 at 08:50, Pali Rohár <pali at kernel.org> wrote:
>
> On Thursday 11 August 2022 08:47:50 Simon Glass wrote:
> > > diff --git a/include/stdio_dev.h b/include/stdio_dev.h
> > > index 270fa2729fb2..06278366ae88 100644
> > > --- a/include/stdio_dev.h
> > > +++ b/include/stdio_dev.h
> > > @@ -37,6 +37,10 @@ struct stdio_dev {
> > >         void (*putc)(struct stdio_dev *dev, const char c);
> > >         /* To put a string (accelerator) */
> > >         void (*puts)(struct stdio_dev *dev, const char *s);
> > > +#ifdef CONFIG_CONSOLE_FLUSH_SUPPORT
> >
> > I'd argue it isn't worth the #ifdef and we might as well have this
> > member here always. Then you can drop some #ifdefs from your code.
>
> But then it will increase binary code size.

Using the member will increase code size. But I think the only place
you need an #ifdef for that is when you include it in the driver
struct. You can use __maybe_unused in the other place.

Having the member will only increase memory usage, not code size.

Regards,
Simon


More information about the U-Boot mailing list