Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D178EB64D7 for ; Tue, 13 Jun 2023 15:01:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21B8D862FD; Tue, 13 Jun 2023 17:01:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="HSAwJpgh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42C4A8628F; Tue, 13 Jun 2023 17:01:05 +0200 (CEST) Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5119286081 for ; Tue, 13 Jun 2023 17:01:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-bb167972cffso6141901276.1 for ; Tue, 13 Jun 2023 08:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1686668460; x=1689260460; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=f+byGki8K4GqMss3ZYjKInP5cc4c+hgfoDsym2DFLEA=; b=HSAwJpgh5vTPj7AUo/WiKKIXVQf2AFCF3gK09PeQxTOsFdqUSF9eOiIU9TEbk+necJ aU0BBt0CrALrBKouJk5B2cidyDLIINlb3tkuyv6spq5KovX4RXbHEYWXiDIOkOVt8/6o yllfY/zc4eBP1Zqv8zfk+wrSYqVmxtizEID+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686668460; x=1689260460; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f+byGki8K4GqMss3ZYjKInP5cc4c+hgfoDsym2DFLEA=; b=EXYXvv4olD+QKw6KDSTlC46WubOryNbBMcb+9twdEH+57pRWm9aCN0gyJuDBCznDQX gKusRlqv570dpeVXV7UjCY96+VCHcMYA5/AlvyZqZ9knE93o701EI14YKNRWhU5O8liS kF9L0UANE9u5tvcwdvqS8qnQjSdO/5mPNWBhr6CVJFTrcvH6gGZusSqCjpJu3wYx4WhN IWN6eUL6BmveaXXrhPKA0/HdPTnJtZ2z5bxJKxWfXiXSKEntmAGTG5J0O4MtaXZ6pcKf y8o1j741L8WdYgBPVZqY9SbiL13NpRTxE1bRESCYaRKow/drlZzTsPEQDJThjAO+o0UR H4xg== X-Gm-Message-State: AC+VfDxjdqLTk4oAtQkxhP9Kqd1Knocwpe5mp1IWE629dy2ELWzux3pI I7FmXOQlS+DuJJMVXjw3mAbd6Q== X-Google-Smtp-Source: ACHHUZ7gCXcKOvOUCSjUH0uLK6cDOZzo22ynAI8imKretFtK8dLtd0MhF24fnBQ1OBmWcMfjD9zgjg== X-Received: by 2002:a25:ae25:0:b0:bcc:d34:cb42 with SMTP id a37-20020a25ae25000000b00bcc0d34cb42mr1548754ybj.0.1686668459779; Tue, 13 Jun 2023 08:00:59 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-b8c8-0809-591a-9a28.res6.spectrum.com. [2603:6081:7b00:6400:b8c8:809:591a:9a28]) by smtp.gmail.com with ESMTPSA id w3-20020a05690202c300b00bad59725e11sm3035472ybh.57.2023.06.13.08.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 08:00:59 -0700 (PDT) Date: Tue, 13 Jun 2023 11:00:57 -0400 From: Tom Rini To: Simon Glass Cc: Sergei Antonov , u-boot@lists.denx.de Subject: Re: [PATCH v2] sandbox: fix a compilation error Message-ID: <20230613150057.GE3931582@bill-the-cat> References: <20230612211904.131477-1-saproj@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+GauBlmERoMlhwyj" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean --+GauBlmERoMlhwyj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 13, 2023 at 03:58:25PM +0100, Simon Glass wrote: > Hi Sergei, >=20 > On Mon, 12 Jun 2023 at 22:19, Sergei Antonov wrote: > > > > With sandbox and sandbox64 configurations: > > > > In file included from .../u-boot/include/test/test.h:156, > > from .../u-boot/include/test/lib.h:9, > > from .../u-boot/test/lib/test_crc8.c:8: > > .../u-boot/arch/sandbox/include/asm/test.h: In function =E2=80=98sandbo= x_sdl_set_bpp=E2=80=99: > > .../u-boot/arch/sandbox/include/asm/test.h:323:17: error: =E2=80=98ENOS= YS=E2=80=99 undeclared (first use in this function) > > 323 | return -ENOSYS; > > | ^~~~~~ > > > > Per Tom Rini's suggestion: > > move that function prototype over to arch/sandbox/include/asm/sdl.h > > and make test/dm/video.c include > > > > Cc: Simon Glass > > Suggested-by: Tom Rini > > Signed-off-by: Sergei Antonov > > --- > > > > v2: > > * move the function to another file instead of including > > > > arch/sandbox/include/asm/sdl.h | 23 +++++++++++++++++++++++ > > arch/sandbox/include/asm/test.h | 25 ------------------------- > > test/dm/video.c | 1 + > > 3 files changed, 24 insertions(+), 25 deletions(-) > > > > diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/= sdl.h > > index 56dcb84803d3..ee4991f7c24a 100644 > > --- a/arch/sandbox/include/asm/sdl.h > > +++ b/arch/sandbox/include/asm/sdl.h > > @@ -7,6 +7,7 @@ > > #define __SANDBOX_SDL_H > > > > #include > > +#include > > > > #ifdef CONFIG_SANDBOX_SDL > > > > @@ -87,6 +88,22 @@ int sandbox_sdl_sound_stop(void); > > */ > > int sandbox_sdl_sound_init(int rate, int channels); > > > > +/** > > + * sandbox_sdl_set_bpp() - Set the depth of the sandbox display > > + * > > + * The device must not be active when this function is called. It acti= viates it > > + * before returning. > > + * > > + * This updates the depth value and adjusts a few other settings accor= dingly. > > + * It must be called before the display is probed. > > + * > > + * @dev: Device to adjust > > + * @l2bpp: depth to set > > + * Return: 0 if the device was already active, other error if it fails= to probe > > + * after the change > > + */ > > +int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp= ); > > + > > #else > > static inline int sandbox_sdl_init_display(int width, int height, int = log2_bpp, > > bool double_size) > > @@ -134,6 +151,12 @@ static inline int sandbox_sdl_sound_init(int rate,= int channels) > > return -ENODEV; > > } > > > > +static inline int sandbox_sdl_set_bpp(struct udevice *dev, > > + enum video_log2_bpp l2bpp) > > +{ > > + return -ENOSYS; > > +} > > + > > #endif > > > > #endif > > diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm= /test.h > > index e482271fe975..17159f8d674a 100644 > > --- a/arch/sandbox/include/asm/test.h > > +++ b/arch/sandbox/include/asm/test.h > > @@ -8,7 +8,6 @@ > > #ifndef __ASM_TEST_H > > #define __ASM_TEST_H > > > > -#include > > #include > > > > struct unit_test_state; > > @@ -300,30 +299,6 @@ void sandbox_cros_ec_set_test_flags(struct udevice= *dev, uint flags); > > */ > > int sandbox_cros_ec_get_pwm_duty(struct udevice *dev, uint index, uint= *duty); > > > > -#if IS_ENABLED(CONFIG_SANDBOX_SDL) > > -/** > > - * sandbox_sdl_set_bpp() - Set the depth of the sandbox display > > - * > > - * The device must not be active when this function is called. It acti= viates it > > - * before returning. > > - * > > - * This updates the depth value and adjusts a few other settings accor= dingly. > > - * It must be called before the display is probed. > > - * > > - * @dev: Device to adjust > > - * @l2bpp: depth to set > > - * Return: 0 if the device was already active, other error if it fails= to probe > > - * after the change > > - */ > > -int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp= ); > > -#else > > -static inline int sandbox_sdl_set_bpp(struct udevice *dev, > > - enum video_log2_bpp l2bpp) > > -{ > > - return -ENOSYS; > > -} > > -#endif > > - > > /** > > * sandbox_set_fake_efi_mgr_dev() - Control EFI bootmgr producing vali= d bootflow > > * > > diff --git a/test/dm/video.c b/test/dm/video.c > > index 30778157d940..1c63d16bd28b 100644 > > --- a/test/dm/video.c > > +++ b/test/dm/video.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include >=20 > The problem with this is it then cannot be built on non-sandbox > boards. I think v1 was OK. I suggested this since the test is sandbox specific (the code itself is full of sandbox_foo). --=20 Tom --+GauBlmERoMlhwyj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmSIhKMACgkQFHw5/5Y0 tyw4KQv+IIRd172rBPuABVROc4VzWySWJBjcx8Up61q04O1t00Q7J9mt7ofHLmmW iEXi2Z/efhed3YFmzzofbYAshFStVa/OENGXNE9X8c0ufP1v8VcMFO2OhcexE129 8RSKA+QIitvkoQy0R3UwPBNYzElCVXfWmuvfGxOEm3aY3f2E3czAFop+QhIG25vj JHGjemp9qhGE8X1plIk7IIYrN0Vp+Lq7tDpTvxk5LehfZMbgtc50zVCCYlkmtgRv ydYSVxNhqyvnD5X4rYIUTfftgFYiAeGGvV8wND4sHlI+VpCmKCnjCKnkjl89OACV Ug7tvzoKo8mAAKdYY0vunZET1oD0TenNJ+118PQGbScOY6ibQjKiz9rlnFhW2Ht7 KV/Cc6sm2rkKh8YeAj/e+XucYjA4+2cP6BwcH0ATyWLKxDJClXeBSd9WpyGtSfd6 7N+nqEdB1FZEuu1zOXhdXmCLaISXCwX20420zrORpDBSW/mOTw0X1BEvcRMzMsL3 0TIXTKCi =ApIT -----END PGP SIGNATURE----- --+GauBlmERoMlhwyj--