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

Pali Rohár
2022-08-11T14:50:26Z

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.

> > + /* To flush output queue */
> > + void (*flush)(struct stdio_dev *dev);
> > +#endif
> >
> > /* INPUT functions */
> >
> > --
> > 2.20.1
> >
>
> Regards,
> SImon