All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Kever Yang <kever.yang@rock-chips.com>,
	Lukasz Czechowski <lukasz.czechowski@thaumatec.com>,
	u-boot@lists.denx.de
Cc: trini@konsulko.com, sjg@chromium.org, philipp.tomsich@vrull.eu
Subject: Re: [PATCH v3 1/4] debug_uart: Replace debug functions with dummies if CONFIG_DEBUG_UART is not set
Date: Mon, 30 Sep 2024 10:55:17 +0200	[thread overview]
Message-ID: <c72f7799-5748-4602-bfb2-c99ba767a614@cherry.de> (raw)
In-Reply-To: <22ae3879-e266-440c-8f25-2d46a5676261@rock-chips.com>

Hi Kever,

On 9/29/24 3:53 AM, Kever Yang wrote:
> Hi Lukasz,
> 
>      I think this will make the error happen like this:
> 
> +common/console.c: In function 'puts':
> +common/console.c:746:29: error: unused variable 'ch' [-Werror=unused- 
> variable]
> +  746 |                         int ch = *s++;
> +      |                             ^~
> +cc1: all warnings being treated as errors
> +make[2]: *** [scripts/Makefile.build:257: common/console.o] Error 1
> 
> 
> The main reason is that below patch removes "#ifdef":
> 
> c04f856822a console: remove #ifdef CONFIG when it is possible
> 

Can you please always share the link to the pipelines that fail so 
people have an idea on how to reproduce it locally?

Here I assume it is: 
https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/22455

A simple way is to apply the patches, build the pine64-lts for example 
and then you'll see warnings (which aren't failing builds locally I 
believe but in CI, yes).

I think we can fool the compiler with the following:

diff --git a/include/debug_uart.h b/include/debug_uart.h
index dc0f1aa4c98..b19e44d6d0f 100644
--- a/include/debug_uart.h
+++ b/include/debug_uart.h
@@ -204,12 +204,12 @@ void printdec(unsigned int value);
  #define DEBUG_UART_FUNCS \
  	#warning "DEBUG_UART not defined!"

-#define printch(ch) do{}while(0);
-#define printascii(str) do{}while(0);
-#define printhex2(value) do{}while(0);
-#define printhex4(value) do{}while(0);
-#define printhex8(value) do{}while(0);
-#define printdec(value) do{}while(0);
+#define printch(ch) do{ (void)(ch); }while(0);
+#define printascii(str) do{ (void)(str); }while(0);
+#define printhex2(value) do{ (void)(value); }while(0);
+#define printhex4(value) do{ (void)(value); }while(0);
+#define printhex8(value) do{ (void)(value); }while(0);
+#define printdec(value) do{ (void)(value); }while(0);

  #endif

Does this make sense?

Cheers,
Quentin

  reply	other threads:[~2024-09-30  8:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 13:01 [PATCH v3 0/4] Rockchip: Allow to silent TPL/SPL debug console Lukasz Czechowski
2024-09-18 13:01 ` [PATCH v3 1/4] debug_uart: Replace debug functions with dummies if CONFIG_DEBUG_UART is not set Lukasz Czechowski
2024-09-29  1:53   ` Kever Yang
2024-09-30  8:55     ` Quentin Schulz [this message]
2024-10-25 12:30       ` Kever Yang
2024-10-25 14:13         ` Tom Rini
2024-10-25 14:27         ` Łukasz Czechowski
2024-10-25 14:56           ` Quentin Schulz
2024-10-31  9:01             ` Kever Yang
2024-11-08  9:33               ` Kever Yang
2024-11-08 20:38                 ` Łukasz Czechowski
2024-11-27  2:41   ` Kever Yang
2024-11-27 22:21     ` Łukasz Czechowski
2025-01-17 16:18       ` Quentin Schulz
2025-05-05 13:53         ` Quentin Schulz
2024-09-18 13:01 ` [PATCH v3 2/4] ram: rockchip: Fix dependency of RAM_ROCKCHIP_DEBUG Lukasz Czechowski
2024-09-18 13:01 ` [PATCH v3 3/4] rockchip: px30: Weaken dependency TPL/SPL serial Lukasz Czechowski
2024-09-18 13:01 ` [PATCH v3 4/4] rockchip: px30: Fix hard dependency to DEBUG_UART_BOARD_INIT Lukasz Czechowski

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=c72f7799-5748-4602-bfb2-c99ba767a614@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=kever.yang@rock-chips.com \
    --cc=lukasz.czechowski@thaumatec.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --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.