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: 9229821 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 866596075D for ; Thu, 14 Jul 2016 13:31:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C462817F for ; Thu, 14 Jul 2016 13:31:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62C7A281DB; Thu, 14 Jul 2016 13:31:22 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD1492817F for ; Thu, 14 Jul 2016 13:31:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751254AbcGNNbV (ORCPT ); Thu, 14 Jul 2016 09:31:21 -0400 Received: from mail-bl2nam02on0079.outbound.protection.outlook.com ([104.47.38.79]:28016 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751051AbcGNNbT (ORCPT ); Thu, 14 Jul 2016 09:31:19 -0400 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: , , , , , , CC: , , 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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);