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 64E58C43334 for ; Tue, 12 Jul 2022 11:18:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 56BD0840E6; Tue, 12 Jul 2022 13:18:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="sSGAk7i9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3ADE84115; Tue, 12 Jul 2022 13:18:34 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09F49840A5 for ; Tue, 12 Jul 2022 13:18:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA06160FCF; Tue, 12 Jul 2022 11:18:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23D39C3411C; Tue, 12 Jul 2022 11:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657624710; bh=bphCOrIHamu4751dtbkvK1eSMmW/PtcSXaj571LnnE8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sSGAk7i9T8tWwLEdhxI8NHbE1aH028mAzM8I+AMvCQVBUA2WEs98YLJ4//rsRpGxj HR0TlY/DdMN/eKQg+OsgVbGlXBZ8maXiQwPDxWLB9bFWcXimCl2tu5150lIE2F7fAk ztRdglFtfbhIWr4ifQjY8K7XldkkixQzghrGJivzhUQ9ieIR4K6+VOvHv4wVwT60i9 ybHkZpP/iRBKpdBVOcAJeo5oq6F2Mv1GWinwDvzXUs4xQU+Cw1BpZ9+zWOPWaE0+V9 3/anFE8yl2Uf7OABflN6Go1ZqUygnHqSzUOC2cxvSd9avwvvhrC0JcWqqobif/RCM0 LJVz7X6kWvwIQ== Received: by pali.im (Postfix) id 3C40CB2D; Tue, 12 Jul 2022 13:18:27 +0200 (CEST) Date: Tue, 12 Jul 2022 13:18:27 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Simon Glass Cc: Troy Kisky , Joe Hershberger , Wolfgang Denk , U-Boot Mailing List Subject: Re: [PATCH 1/2] Fix usage of CONFIG_PREBOOT Message-ID: <20220712111827.7ssc23yleoi6yedy@pali> References: <20220710114256.27322-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 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 On Tuesday 12 July 2022 04:58:51 Simon Glass wrote: > Hi Pali, > > On Sun, 10 Jul 2022 at 05:43, Pali Rohár wrote: > > > > Due to usage of PREBOOT in Kconfig, macro CONFIG_PREBOOT is always defined > > when CONFIG_USE_PREBOOT is enabled. In case CONFIG_PREBOOT is not > > explicitly enabled it is set to empty C string and therefore > > '#ifdef CONFIG_PREBOOT' guard does not work. Fix this issue by introducing > > a new Kconfig symbol PREBOOT_DEFINED which cause to define new C macro > > CONFIG_PREBOOT_DEFINED only when CONFIG_PREBOOT is really defined. > > > > Change usage of '#ifdef CONFIG_PREBOOT' by '#ifdef CONFIG_USE_PREBOOT' for > > code which checks if preboot code would be called and by > > '#ifdef CONFIG_PREBOOT_DEFINED' for defining preboot code. > > > > Signed-off-by: Pali Rohár > > --- > > board/boundary/nitrogen6x/nitrogen6x.c | 4 ++-- > > boot/Kconfig | 4 ++++ > > include/env_default.h | 2 +- > > 3 files changed, 7 insertions(+), 3 deletions(-) > > Can you not use: > > #idef CONFIG_USE_PREBOOT > > ? Where? > You should not be checking for the existence of a string Kconfig. I do not see other option, because this is how kconfig is working. When string option is not set then kconfig defines it to empty string. > Regards, > Simon