Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7057345ybi; Thu, 13 Jun 2019 08:51:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxka2Q839WAgNovT3HtbBlmc83TcTn4Q25tCbcKMo1FyAQpRSxQhHMlWVuvFIuS9meN60PF X-Received: by 2002:a62:5487:: with SMTP id i129mr89162958pfb.68.1560441106591; Thu, 13 Jun 2019 08:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560441106; cv=none; d=google.com; s=arc-20160816; b=BSS1PJt9+ejNvucysakcY3zv0uRmv23ZWYC7DqkuJiSBrk26uMxvKVKOXdXAK1syPO 86Q21SHbVqm/yhyEEdEhtuiZS8KL//up3dNGoLwueA3JlCax+hD41X+i5EC8nNNd+HJo a2jBSdz0Bi3pPNICpC3fkjBT4SiBd39DKOojjPEec4H4MLVQ1CryekEQmiz5ym8jaIzP 4I9ojjIGDp4SWAc9LKHtZuR4k2NnTkEiMoApTt/bQMxIgwhjU5GSr52UXyWVLJ5EpZkn JGWp9GzI3MObJ4EymUGNvpm0Oys10WsVfhfZmj7vj5mRxIDN3IABfNLVnTPfN3FPLRhC mWxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=mqHvMNCVo1J8F/0+o546XcKtxPNuB5rRLMclAu10TBw=; b=LVxyWHNPmu2Dtl+JljGK+YStNWYRWTyPyHM/WCGm5yWOdXjY99XE3lXCcNA7QJ1lll arcY5EbezX6caDj8kSNnfBnmdqLzFwYA7j/9MhBYrnncA4RF3DsfekMZ8Hh3TG2CAJpe uSQjZdFPH1g7fcEjkApGi6A2d8jNhM/UaBbU/FHQvwVowxvuQzf7fCNg4ULYhTDQkfhh TV3sZLtWj22z9OE939Iitd9OtrjZp62kpO5NVDsmI7yJmWtjazV41pGuIudCJAfj2ftX fCjri5YT/FvREIWdffCYiAsEpArm8Lbvx0BnH4XSl0U8TFZstpaUf8m3Ww0KClADcw/b u84Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=sjMYA3Q7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si66015pgl.508.2019.06.13.08.51.31; Thu, 13 Jun 2019 08:51:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=sjMYA3Q7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388158AbfFMPu4 (ORCPT + 99 others); Thu, 13 Jun 2019 11:50:56 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:33401 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731673AbfFMJMD (ORCPT ); Thu, 13 Jun 2019 05:12:03 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 45PdKW6XMlzB09Zq; Thu, 13 Jun 2019 11:11:59 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=sjMYA3Q7; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id ZVuszKe76_fZ; Thu, 13 Jun 2019 11:11:59 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 45PdKW5VLhzB09Zg; Thu, 13 Jun 2019 11:11:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1560417119; bh=mqHvMNCVo1J8F/0+o546XcKtxPNuB5rRLMclAu10TBw=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=sjMYA3Q70EyzBqP9X7rFgnKphniWcmh5J7A1+eDIphhqIg99FrLEz/FsIOqxpujPJ deHosTzsF3S/IekJUb9/XjNwsb9adITrCG/IL9BbFeaZeqax7CFlAY/q/GFuZeq0il 4vk9dyLi7WolJ9TN/JxTbKmbBE6P6xYBFIHhSRU4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D86818B8C0; Thu, 13 Jun 2019 11:12:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id PUiRkJUwmOiS; Thu, 13 Jun 2019 11:12:00 +0200 (CEST) Received: from po16838vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 95A498B8B9; Thu, 13 Jun 2019 11:12:00 +0200 (CEST) Received: by po16838vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 487D968B1D; Thu, 13 Jun 2019 09:12:00 +0000 (UTC) Message-Id: In-Reply-To: <1930b7e67ab361e68f356e7fdeba403e32ce3ad0.1560416986.git.christophe.leroy@c-s.fr> References: <1930b7e67ab361e68f356e7fdeba403e32ce3ad0.1560416986.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v2 08/10] powerpc/8xx: replace #ifdefs by IS_ENABLED() in microcode.c To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , oss@buserror.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 13 Jun 2019 09:12:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reduce #ifdef mess by using IS_ENABLED() instead. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/micropatch.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/platforms/8xx/micropatch.c b/arch/powerpc/platforms/8xx/micropatch.c index 02490c54ebac..252db7c90599 100644 --- a/arch/powerpc/platforms/8xx/micropatch.c +++ b/arch/powerpc/platforms/8xx/micropatch.c @@ -243,14 +243,9 @@ static void __init cpm_write_patch(cpm8xx_t *cp, int offset, uint *patch, int le void __init cpm_load_patch(cpm8xx_t *cp) { volatile cpm8xx_t *commproc; -#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \ - defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH) volatile iic_t *iip; volatile struct spi_pram *spp; -#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH volatile smc_uart_t *smp; -#endif -#endif commproc = cp; commproc->cp_rccr = 0; @@ -259,24 +254,22 @@ void __init cpm_load_patch(cpm8xx_t *cp) cpm_write_patch(cp, 0xf00, patch_2f00, sizeof(patch_2f00)); cpm_write_patch(cp, 0xe00, patch_2e00, sizeof(patch_2e00)); -#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \ - defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH) - - iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC]; -# define RPBASE 0x0500 - iip->iic_rpbase = RPBASE; + if (IS_ENABLED(CONFIG_I2C_SPI_UCODE_PATCH) || + IS_ENABLED(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)) { + u16 rpbase = 0x500; - /* Put SPI above the IIC, also 32-byte aligned. - */ - spp = (struct spi_pram *)&commproc->cp_dparam[PROFF_SPI]; - spp->rpbase = (RPBASE + sizeof(iic_t) + 31) & ~31; + iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC]; + iip->iic_rpbase = rpbase; -# if defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH) - smp = (smc_uart_t *)&commproc->cp_dparam[PROFF_SMC1]; - smp->smc_rpbase = 0x1FC0; -# endif /* CONFIG_I2C_SPI_SMC1_UCODE_PATCH) */ + /* Put SPI above the IIC, also 32-byte aligned. */ + spp = (struct spi_pram *)&commproc->cp_dparam[PROFF_SPI]; + spp->rpbase = (rpbase + sizeof(iic_t) + 31) & ~31; -#endif /* some variation of the I2C/SPI patch was selected */ + if (IS_ENABLED(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)) { + smp = (smc_uart_t *)&commproc->cp_dparam[PROFF_SMC1]; + smp->smc_rpbase = 0x1FC0; + } + } commproc->cp_cpmcr1 = patch_params.cpmcr1; commproc->cp_cpmcr2 = patch_params.cpmcr2; -- 2.13.3