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: 353330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E6A981400CF for ; Wed, 28 May 2014 20:47:58 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbaE1Krz (ORCPT ); Wed, 28 May 2014 06:47:55 -0400 Received: from mail-bl2lp0211.outbound.protection.outlook.com ([207.46.163.211]:7808 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752510AbaE1Krx (ORCPT ); Wed, 28 May 2014 06:47:53 -0400 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: CC: , , , , , 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 Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org 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)