From patchwork Wed May 28 10:50:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 4254441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50920BF90B for ; Wed, 28 May 2014 10:50:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E5CA202A1 for ; Wed, 28 May 2014 10:50:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57BED20279 for ; Wed, 28 May 2014 10:50:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpbOw-0001rh-SH; Wed, 28 May 2014 10:48:06 +0000 Received: from dns-bn1lp0143.outbound.protection.outlook.com ([207.46.163.143] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpbOs-0001mU-PY for linux-arm-kernel@lists.infradead.org; Wed, 28 May 2014 10:48:03 +0000 Received: from BLUPR03CA029.namprd03.prod.outlook.com (10.141.30.22) by BLUPR03MB343.namprd03.prod.outlook.com (10.141.48.21) with Microsoft SMTP Server (TLS) id 15.0.954.9; Wed, 28 May 2014 10:47:39 +0000 Received: from BY2FFO11FD023.protection.gbl (2a01:111:f400:7c0c::173) by BLUPR03CA029.outlook.office365.com (2a01:111:e400:879::22) with Microsoft SMTP Server (TLS) id 15.0.949.11 via Frontend Transport; Wed, 28 May 2014 10:47:39 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD023.mail.protection.outlook.com (10.1.15.212) with Microsoft SMTP Server (TLS) id 15.0.949.9 via Frontend Transport; Wed, 28 May 2014 10:47:38 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s4SAlWY1001704; Wed, 28 May 2014 03:47:34 -0700 From: Liu Ying To: Subject: [PATCH 1/3] pwm: i.MX: Fix the macro MX3_PWMCR_PRESCALER(x) definition Date: Wed, 28 May 2014 18:50:11 +0800 Message-ID: <1401274213-8954-1-git-send-email-Ying.Liu@freescale.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(97736001)(77096999)(50986999)(99396002)(84676001)(85852003)(87286001)(87936001)(31966008)(104166001)(4396001)(74662001)(50226001)(19580395003)(68736004)(88136002)(44976005)(62966002)(102836001)(83322001)(92726001)(80022001)(23676002)(36756003)(21056001)(26826002)(93916002)(81542001)(20776003)(86362001)(50466002)(6806004)(83072002)(575784001)(74502001)(89996001)(64706001)(79102001)(46102001)(104016001)(92566001)(77156001)(77982001)(81342001)(76482001)(19580405001)(47776003); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB343; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Forefront-PRVS: 0225B0D5BC Received-SPF: Fail (: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Ying.Liu@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140528_034803_000232_E6A62718 X-CRM114-Status: UNSURE ( 8.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, thierry.reding@gmail.com, shawn.guo@freescale.com, linux-arm-kernel@lists.infradead.org, LW@KARO-electronics.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds missing parentheses around the argument of the macro MX3_PWMCR_PRESCALER(x) to avoid any potential macro expansion issue. Reported-by: Lothar Waßmann Cc: Thierry Reding Cc: Sascha Hauer Cc: Shawn Guo Cc: Lothar Waßmann Cc: linux-pwm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Liu Ying --- drivers/pwm/pwm-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c index cc47733..9835e0b 100644 --- a/drivers/pwm/pwm-imx.c +++ b/drivers/pwm/pwm-imx.c @@ -32,7 +32,7 @@ #define MX3_PWMCR 0x00 /* PWM Control Register */ #define MX3_PWMSAR 0x0C /* PWM Sample Register */ #define MX3_PWMPR 0x10 /* PWM Period Register */ -#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4) +#define MX3_PWMCR_PRESCALER(x) ((((x) - 1) & 0xFFF) << 4) #define MX3_PWMCR_DOZEEN (1 << 24) #define MX3_PWMCR_WAITEN (1 << 23) #define MX3_PWMCR_DBGEN (1 << 22)