From patchwork Thu Jul 14 13:30:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Appana Durga Kedareswara rao X-Patchwork-Id: 9229825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2E0B6075D for ; Thu, 14 Jul 2016 13:33:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D35442817F for ; Thu, 14 Jul 2016 13:33:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C799B2808C; Thu, 14 Jul 2016 13:33:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8AC82808C for ; Thu, 14 Jul 2016 13:33:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNgk6-0007eT-Nk; Thu, 14 Jul 2016 13:31:54 +0000 Received: from mail-cys01nam02on0074.outbound.protection.outlook.com ([104.47.37.74] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNgjl-0007LW-H2 for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2016 13:31:36 +0000 Received: from CY1NAM02FT041.eop-nam02.prod.protection.outlook.com (10.152.74.51) by CY1NAM02HT225.eop-nam02.prod.protection.outlook.com (10.152.74.125) with Microsoft SMTP Server (TLS) id 15.1.523.9; Thu, 14 Jul 2016 13:31:10 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT041.mail.protection.outlook.com (10.152.74.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.539.16 via Frontend Transport; Thu, 14 Jul 2016 13:31:07 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:34625 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1bNgjH-0002aA-4x; Thu, 14 Jul 2016 06:31:03 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1bNgjK-0000La-Oe; Thu, 14 Jul 2016 06:31:06 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u6EDUweY029838; Thu, 14 Jul 2016 06:30:58 -0700 Received: from [172.23.64.207] (helo=xhd-lin64re117.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1bNgjB-0000Hh-Qb; Thu, 14 Jul 2016 06:30:58 -0700 Received: by xhd-lin64re117.xilinx.com (Postfix, from userid 13614) id 065D3208F3; Thu, 14 Jul 2016 19:00:56 +0530 (IST) From: Kedareswara rao Appana To: , , , , , , Subject: [PATCH v2] dmaengine: zynqmp_dma: Fix static checker warning Date: Thu, 14 Jul 2016 19:00:55 +0530 Message-ID: <1468503055-20197-1-git-send-email-appanad@xilinx.com> X-Mailer: git-send-email 2.1.1 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22450.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(86362001)(586003)(92566002)(8676002)(81166006)(11100500001)(19580405001)(19580395003)(2201001)(47776003)(5001770100001)(52956003)(356003)(81156014)(7846002)(36756003)(90966002)(87936001)(50986999)(8936002)(50226002)(229853001)(63266004)(42186005)(5003940100001)(33646002)(2906002)(50466002)(48376002)(4326007)(103686003)(45336002)(36386004)(46386002)(305945005)(106466001)(189998001)(107986001)(5001870100001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1NAM02HT225; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 85002692-1d0b-4e51-9dfe-08d3abeb1e39 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:CY1NAM02HT225; X-Microsoft-Antispam-PRVS: <7699def6c1924de39432ddab80c15d57@CY1NAM02HT225.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13024025)(13023025)(13017025)(13015025)(5005006)(13018025)(3002001)(10201501046)(6055026); SRVR:CY1NAM02HT225; BCL:0; PCL:0; RULEID:; SRVR:CY1NAM02HT225; X-Forefront-PRVS: 00032065B2 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2016 13:31:07.6190 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT225 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160714_063133_891481_C19F7436 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the below static checker warning drivers/dma/xilinx/zynqmp_dma.c:973 zynqmp_dma_chan_probe() warn: was && intended here instead of ||? Reported-by: Dan Carpenter Signed-off-by: Kedareswara rao Appana --- Changes for v2: ---> Return EINVAL instead of err as suggested by Dan. drivers/dma/xilinx/zynqmp_dma.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c index f777a5b..b18d51f 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -970,12 +970,17 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev, chan->dst_burst_len = ZYNQMP_DMA_AWLEN_RST_VAL; chan->src_burst_len = ZYNQMP_DMA_ARLEN_RST_VAL; err = of_property_read_u32(node, "xlnx,bus-width", &chan->bus_width); - if ((err < 0) && ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) || - (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128))) { - dev_err(zdev->dev, "invalid bus-width value"); + if (err < 0) { + dev_err(&pdev->dev, "missing xlnx,bus-width property\n"); return err; } + if (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64 && + chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128) { + dev_err(zdev->dev, "invalid bus-width value"); + return -EINVAL; + } + chan->is_dmacoherent = of_property_read_bool(node, "dma-coherent"); zdev->chan = chan; tasklet_init(&chan->tasklet, zynqmp_dma_do_tasklet, (ulong)chan);