From patchwork Fri Jul 24 18:23:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11683995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C01C1392 for ; Fri, 24 Jul 2020 18:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83B6820771 for ; Fri, 24 Jul 2020 18:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595615078; bh=j4OZBd61HSNkr1Rlja2ZzFgA907VpAkAmZpKbAqpmVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Njldgzt3q44JqmYoSMjoVO3B5xXOXjemxWoIe9VxwuwSi1N9XATCztlbKH1AflUPB 5qleCFI36W3KpUA5y4tBSdRMrTVAcrtbvRj5Bjp0uxcCSngVwaI+H3rh3BZSNA3ODo asLFhwAXceo+YIO3lFnwEsbQEr8/q6bKTaS/0cdo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726989AbgGXSYf (ORCPT ); Fri, 24 Jul 2020 14:24:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:33126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbgGXSYe (ORCPT ); Fri, 24 Jul 2020 14:24:34 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87B7F2073E; Fri, 24 Jul 2020 18:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595615073; bh=j4OZBd61HSNkr1Rlja2ZzFgA907VpAkAmZpKbAqpmVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k8QAns7qKb8Dc2oZQ/yfh5QXJZiffCMebqBOUuQS/n3u0dNw1MP9UNKdN9CfXyxUv 42wvVlq4zIQ3R+8VW9b2MVS0KBJ88HgJvxQcJXOQDbggs/neMOTEwHwcFwdGxD8hKW ddpcK2x6tzwTXJ4ERLJkOutwIka1XgMsxGymt67Y= From: Krzysztof Kozlowski To: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Russell King , Catalin Marinas , Will Deacon , Krzysztof Kozlowski , Markus Mayer , Roger Quadros , Tony Lindgren , Vladimir Zapolskiy , Kukjin Kim , Lukasz Luba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Cc: Olof Johansson , Arnd Bergmann Subject: [PATCH 05/16] memory: omap-gpmc: Enclose macro argument usage in parenthesis Date: Fri, 24 Jul 2020 20:23:17 +0200 Message-Id: <20200724182328.3348-6-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724182328.3348-1-krzk@kernel.org> References: <20200724182328.3348-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Macros arguments should be enclosed by parenthesis for safety. Signed-off-by: Krzysztof Kozlowski --- drivers/memory/omap-gpmc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index c91a021ac421..62577255ba0f 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -107,8 +107,8 @@ #define ENABLE_PREFETCH (0x1 << 7) #define DMA_MPU_MODE 2 -#define GPMC_REVISION_MAJOR(l) ((l >> 4) & 0xf) -#define GPMC_REVISION_MINOR(l) (l & 0xf) +#define GPMC_REVISION_MAJOR(l) (((l) >> 4) & 0xf) +#define GPMC_REVISION_MINOR(l) ((l) & 0xf) #define GPMC_HAS_WR_ACCESS 0x1 #define GPMC_HAS_WR_DATA_MUX_BUS 0x2 @@ -139,27 +139,27 @@ #define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28) #define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27) #define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27) -#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25) +#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) (((val) & 3) << 25) /** CLKACTIVATIONTIME Max Ticks */ #define GPMC_CONFIG1_CLKACTIVATIONTIME_MAX 2 -#define GPMC_CONFIG1_PAGE_LEN(val) ((val & 3) << 23) +#define GPMC_CONFIG1_PAGE_LEN(val) (((val) & 3) << 23) /** ATTACHEDDEVICEPAGELENGTH Max Value */ #define GPMC_CONFIG1_ATTACHEDDEVICEPAGELENGTH_MAX 2 #define GPMC_CONFIG1_WAIT_READ_MON (1 << 22) #define GPMC_CONFIG1_WAIT_WRITE_MON (1 << 21) -#define GPMC_CONFIG1_WAIT_MON_TIME(val) ((val & 3) << 18) +#define GPMC_CONFIG1_WAIT_MON_TIME(val) (((val) & 3) << 18) /** WAITMONITORINGTIME Max Ticks */ #define GPMC_CONFIG1_WAITMONITORINGTIME_MAX 2 -#define GPMC_CONFIG1_WAIT_PIN_SEL(val) ((val & 3) << 16) -#define GPMC_CONFIG1_DEVICESIZE(val) ((val & 3) << 12) +#define GPMC_CONFIG1_WAIT_PIN_SEL(val) (((val) & 3) << 16) +#define GPMC_CONFIG1_DEVICESIZE(val) (((val) & 3) << 12) #define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) /** DEVICESIZE Max Value */ #define GPMC_CONFIG1_DEVICESIZE_MAX 1 -#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10) +#define GPMC_CONFIG1_DEVICETYPE(val) (((val) & 3) << 10) #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) -#define GPMC_CONFIG1_MUXTYPE(val) ((val & 3) << 8) +#define GPMC_CONFIG1_MUXTYPE(val) (((val) & 3) << 8) #define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4) -#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3) +#define GPMC_CONFIG1_FCLK_DIV(val) ((val) & 3) #define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1)) #define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2)) #define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))