[PATCH v3 3/4] console: remove #ifdef CONFIG_CONSOLE_RECORD

Patrick DELAUNAY patrick.delaunay at foss.st.com
Mon Jan 4 14:18:19 CET 2021


On 12/19/20 4:34 AM, Simon Glass wrote:
> On Fri, 18 Dec 2020 at 04:46, Patrick Delaunay
> <patrick.delaunay at foss.st.com> wrote:
>> From: Patrick Delaunay <patrick.delaunay at st.com>
>>
>> Add helper functions to access to gd->console_out and gd->console_in
> I don't see those in this patch

These helper function are console_record_putc() / _puts()  / _getc() / 
_tstc();

they use "gd->console_out" and "gd->console_in" only if 
CONFIG_CONSOLE_RECORD is defined:

diff --git a/common/console.c b/common/console.c index 
036dd0358a..295c10f242 100644

--- a/common/console.c

+++ b/common/console.c

@@ -88,6 +88,64 @@ static int on_silent(const char *name, const char 
*value, enum env_op op, U_BOOT_ENV_CALLBACK(silent, on_silent); #endif

+#ifdef CONFIG_CONSOLE_RECORD

+/* helper function: access to gd->console_out and gd->console_in */

...

+#else

... stubs => do nothings

+#endif

>
>> with membuff API and replace the #ifdef CONFIG_CONSOLE_RECORD test
>> by if (IS_ENABLED(CONFIG_CONSOLE_RECORD)) to respect the U-Boot
>> coding rule.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
>> ---
>>
>> (no changes since v2)
>>
>> Changes in v2:
>> - move the tests on gd->flags & GD_FLG_RECORD in helper functions
>> - remove test on IS_ENABLED(CONFIG_CONSOLE_RECORD)
>>    before to call helper functions
>>
>>   common/console.c | 95 +++++++++++++++++++++++++++++++++++++-----------
>>   1 file changed, 73 insertions(+), 22 deletions(-)
>>
> Reviewed-by: Simon Glass <sjg at chromium.org>


Regards

Patrick



More information about the U-Boot mailing list