From mboxrd@z Thu Jan 1 00:00:00 1970 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 F046EC433F5 for ; Fri, 14 Jan 2022 13:36:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F6FB83565; Fri, 14 Jan 2022 14:35:09 +0100 (CET) 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="UuhmaV6k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5BEBD833BE; Fri, 14 Jan 2022 14:34:47 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 5750483518 for ; Fri, 14 Jan 2022 14:34:29 +0100 (CET) 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 ams.source.kernel.org (Postfix) with ESMTPS id 054A5B825F0; Fri, 14 Jan 2022 13:34:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B25DFC36AEB; Fri, 14 Jan 2022 13:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642167267; bh=moLOBUIKrwGB9gpb8PLozMWjDOX5iXEgSPADJv8K/ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuhmaV6k4k4wq+ug4yX+Lm84yEsdcvgoMv/brUo0D7X25ig5Y+54QMv1KvvnT2Qir VCM4SqkCzFY+Aj8OC5q7HXmofOzjYSlw3S1P4voDgvBxDRt1RN9ICjeDaQlcrUEULE VApohjZ+YRxB9ionBI7qwx53vXFXp0k/NocPb98xbyGVbDU4L+xNARzlAsXhrtZV3B wmG4/LS2wCC/UC9tCbrk+AkhUs5VaArYzHXdfY5tvgD1GKLhvJtE2a7h9EJZ9OZBxX qgJ+4C+kLMfKnHuxB8nhTyh9WA3HVEXONMkrnf9RISoicWnQgQbecDi2IiPqlHzHvV 6GwcuatNrc93A== Received: by pali.im (Postfix) id 6BFC97D1; Fri, 14 Jan 2022 14:34:27 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese Cc: u-boot@lists.denx.de, =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell v4 8/9] arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible Date: Fri, 14 Jan 2022 14:31:44 +0100 Message-Id: <20220114133145.32329-9-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220114133145.32329-1-pali@kernel.org> References: <20220114133145.32329-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.2 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn Use the preferred if (IS_ENABLED(X)) instead of #ifdef X where possible. There are still places where this is not possible or is more complicated to convert in this file. Leave those be for now. Signed-off-by: Marek BehĂșn Reviewed-by: Stefan Roese --- arch/arm/mach-mvebu/spl.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index 103049b49b89..5006f9e80bb0 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -149,26 +149,24 @@ int spl_parse_board_header(struct spl_image_info *spl_image, return -EINVAL; } -#ifdef CONFIG_SPL_SPI_FLASH_SUPPORT - if (bootdev->boot_device == BOOT_DEVICE_SPI && + if (IS_ENABLED(CONFIG_SPL_SPI_FLASH_SUPPORT) && + bootdev->boot_device == BOOT_DEVICE_SPI && mhdr->blockid != IBR_HDR_SPI_ID) { printf("ERROR: Wrong blockid (0x%x) in SPI kwbimage\n", mhdr->blockid); return -EINVAL; } -#endif -#ifdef CONFIG_SPL_SATA - if (bootdev->boot_device == BOOT_DEVICE_SATA && + if (IS_ENABLED(CONFIG_SPL_SATA) && + bootdev->boot_device == BOOT_DEVICE_SATA && mhdr->blockid != IBR_HDR_SATA_ID) { printf("ERROR: Wrong blockid (0x%x) in SATA kwbimage\n", mhdr->blockid); return -EINVAL; } -#endif -#ifdef CONFIG_SPL_MMC - if ((bootdev->boot_device == BOOT_DEVICE_MMC1 || + if (IS_ENABLED(CONFIG_SPL_MMC) && + (bootdev->boot_device == BOOT_DEVICE_MMC1 || bootdev->boot_device == BOOT_DEVICE_MMC2 || bootdev->boot_device == BOOT_DEVICE_MMC2_2) && mhdr->blockid != IBR_HDR_SDIO_ID) { @@ -176,18 +174,16 @@ int spl_parse_board_header(struct spl_image_info *spl_image, mhdr->blockid); return -EINVAL; } -#endif spl_image->offset = mhdr->srcaddr; -#ifdef CONFIG_SPL_SATA /* * For SATA srcaddr is specified in number of sectors. * The main header is must be stored at sector number 1. * This expects that sector size is 512 bytes and recalculates * data offset to bytes relative to the main header. */ - if (mhdr->blockid == IBR_HDR_SATA_ID) { + if (IS_ENABLED(CONFIG_SPL_SATA) && mhdr->blockid == IBR_HDR_SATA_ID) { if (spl_image->offset < 1) { printf("ERROR: Wrong srcaddr (0x%08x) in SATA kwbimage\n", spl_image->offset); @@ -196,17 +192,14 @@ int spl_parse_board_header(struct spl_image_info *spl_image, spl_image->offset -= 1; spl_image->offset *= 512; } -#endif -#ifdef CONFIG_SPL_MMC /* * For SDIO (eMMC) srcaddr is specified in number of sectors. * This expects that sector size is 512 bytes and recalculates * data offset to bytes. */ - if (mhdr->blockid == IBR_HDR_SDIO_ID) + if (IS_ENABLED(CONFIG_SPL_MMC) && mhdr->blockid == IBR_HDR_SDIO_ID) spl_image->offset *= 512; -#endif if (spl_image->offset % 4 != 0) { printf("ERROR: Wrong srcaddr (0x%08x) in kwbimage\n", -- 2.20.1