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 D5037C54EE9 for ; Tue, 20 Sep 2022 19:05:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F5F784C79; Tue, 20 Sep 2022 21:04:59 +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="kfAxRM7W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7768484C79; Tue, 20 Sep 2022 21:04:58 +0200 (CEST) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 04CB784C83 for ; Tue, 20 Sep 2022 21:04:55 +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-qk1-x735.google.com with SMTP id o7so2343401qkj.10 for ; Tue, 20 Sep 2022 12:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=WnI8zknOPwfBv35EZJGGPBp/aQocYRCjs7BMAkLcUL8=; b=kfAxRM7WCijQSAuam/57LuI6JM3tqphQ/iMZz0hP3DtJAnyt82+IzdpsEzLEoA3mXn IkJ8HlhzXD8UWoFAYv+GEwpLN/ZwCRps21jSmQ/28oLBcYecJ180A4UtgpAX5Y4HRSMC HZmtn9xTej7SYjxXhy1tc8PHbSgmY5YrMrjls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=WnI8zknOPwfBv35EZJGGPBp/aQocYRCjs7BMAkLcUL8=; b=GySnXeKtW2nnu6smIg7D4fz/A8Rn9n8EOOmG7Og4AdUH6l1W1s3XY4pg31IUvv8tfO aZ2av6PgxI+wSP6aRC1CPp3yptm7gNydHgkgElUe4MoIb7t3xd2rkeBJcCTb/KS4TCWl zym0zz5YRwGdRGsDuIZ+QQqJ1FkaNR3k/GVT+lW/nVHyUMGcwqBIzD2Uf5zwkVYUHagU Tv6bFA05Yi4OM90lEjfwmKSxTaz1t11VFprQnGn9Hg+GBFlTSbFz4Myl/fwgNbWhejyZ 1wpmq8wJ1LhawZIDg5ulR+9Hw86nxIKf3gchrS76Wi6oh3BROkJkU/YKIZgAlYHvYc3w 1p1A== X-Gm-Message-State: ACrzQf2w9iDeawm2s5BH462GjUsv0gdPFnTKrlStofXc/HfdLUJdy/Ak ySquknd5iPfdiOWivF4K6a9vog== X-Google-Smtp-Source: AMsMyM5iTVu/400f/jrdXdHqmwQZIzjkO0pwwF2ty95t+63X1YTP4+0m7SRySQ8cGnyXw0IjXX3YqA== X-Received: by 2002:a05:620a:1346:b0:6ce:38a0:fe5e with SMTP id c6-20020a05620a134600b006ce38a0fe5emr17202038qkl.136.1663700694646; Tue, 20 Sep 2022 12:04:54 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-0ca7-0a1a-8231-1683.res6.spectrum.com. [2603:6081:7b00:6400:ca7:a1a:8231:1683]) by smtp.gmail.com with ESMTPSA id c7-20020ac85a87000000b0035a691cec8esm281144qtc.29.2022.09.20.12.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 12:04:53 -0700 (PDT) Date: Tue, 20 Sep 2022 15:04:52 -0400 From: Tom Rini To: Marek Vasut Cc: Simon Glass , U-Boot Mailing List Subject: Re: [RFC][PATCH] spl: Turn spl_board_init() into weak symbol Message-ID: <20220920190452.GM3044094@bill-the-cat> References: <20220919195204.106370-1-marex@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Yia77v5a8fyVHJSl" 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.6 at phobos.denx.de X-Virus-Status: Clean --Yia77v5a8fyVHJSl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 20, 2022 at 05:56:50PM +0200, Marek Vasut wrote: > On 9/20/22 17:43, Simon Glass wrote: > > On Mon, 19 Sept 2022 at 21:52, Marek Vasut wrote: > > >=20 > > > Make spl_board_init() a weak symbol and get rid of Kconfig symbols > > > and ifdeffery guarding this function. Since the spl_board_init() is > > > now a weak symbol, boards can either use the default implementation > > > which is empty and gets inlined with zero text increase, or override > > > the implementation with their own as needed. > > >=20 > > > Signed-off-by: Marek Vasut > > > --- > > > Cc: Simon Glass > > > Cc: Tom Rini > > > --- > >=20 > > Reviewed-by: Simon Glass > >=20 > > but please add a nice comment to spl_board_init() indicating what it > > is for and when it is called. >=20 > Actually, I wonder, should we start turning all the other symbols which a= re > now protected by Kconfig symbol (the #ifdef CONFIG_FOO) into weak symbols > without any need for Kconfig symbol guard instead as well? I'm not sure this is a good idea. An #ifdef in and of itself is not a bad thing, and now we add a dummy function on another set of platforms. What is true is that a lot of SPL_foo symbols should be select'd rather than asked because it's not an option. You enable it, it works, you disable it, your platform doesn't work. If it's just the #if, we could rewrite the line as if (CONFIG_IS_ENABLED(BOARD_INIT)) spl_board_init(); as the prototype shouldn't be guarded anyhow. --=20 Tom --Yia77v5a8fyVHJSl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMqDtAACgkQFHw5/5Y0 tywPVQv+NgnWNbvporYJkIQfE/Wc5D2S/avphiKX8u4SBSqokM+xOrsOh6w9rYYZ TVbhKvMqRbb6TK+Z+bKo5ZXIrtsA/jSmnr2NJ2aVeSfncBlTUrvvmVDudSlhh72W mk67x7yINxNMZXUOKOmojtPIe69di64aNLXXLAowz04h0AiHMDQNqSlQeImmhNgb 9nU8eQKAS/ZxyCKrLzuvyxCScbALe5KgU7DzOo9UKF7VbVa3PuD4JAur5agyL20U bgQy2hSZTQSSeuNmkH0jVepEZpJON7LLt2rAiwo9tg1F5tOuONacC36nGzfsDVNv NKla0BwWzSwdtts9w7lGnWKtIAhdreRpSW1zlLyCPGCF4uMov/0QiE3Pis8j82lv s8UsSzXIQSHHwMgNUIQyPckDujhZc6+/Vruvp1upfJPAbQ7aUUug/vLsBdUt0EmN 3e3QooIVK0A+qnlCBmiUkdglpL0u5VlGN7os25YN3ZShfktlygafgqwRdUfovOjg 1MH3lpo/ =5Z0H -----END PGP SIGNATURE----- --Yia77v5a8fyVHJSl--