From patchwork Wed Feb 20 15:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varun Prakash X-Patchwork-Id: 10822387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B8851399 for ; Wed, 20 Feb 2019 15:36:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E800D2EBC9 for ; Wed, 20 Feb 2019 15:36:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAC652ECBE; Wed, 20 Feb 2019 15:36:08 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 48D292EBC9 for ; Wed, 20 Feb 2019 15:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbfBTPgH (ORCPT ); Wed, 20 Feb 2019 10:36:07 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:35650 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbfBTPgH (ORCPT ); Wed, 20 Feb 2019 10:36:07 -0500 Received: from fcoe-test11.asicdesigners.com (fcoe-test11.blr.asicdesigners.com [10.193.185.180]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id x1KFZiIA022160; Wed, 20 Feb 2019 07:35:50 -0800 From: Varun Prakash To: martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, dt@chelsio.com, indranil@chelsio.com, varun@chelsio.com, stable@vger.kernel.org, Christoph Hellwig Subject: [PATCH] scsi: csiostor: fix incorrect if condition for setting dma mask Date: Wed, 20 Feb 2019 21:05:21 +0530 Message-Id: <1550676921-5764-1-git-send-email-varun@chelsio.com> X-Mailer: git-send-email 2.0.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use && instead of || in if condition as dma_set_mask_and_coherent() returns 0 on success. Fixes: c22b332d811b ("scsi: csiostor: switch to generic DMA API") Cc: stable@vger.kernel.org Cc: Christoph Hellwig Signed-off-by: Varun Prakash --- drivers/scsi/csiostor/csio_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c index cf629380a981..e7ad7b1a0440 100644 --- a/drivers/scsi/csiostor/csio_init.c +++ b/drivers/scsi/csiostor/csio_init.c @@ -210,7 +210,7 @@ csio_pci_init(struct pci_dev *pdev, int *bars) pci_set_master(pdev); pci_try_set_mwi(pdev); - if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || + if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) && dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { dev_err(&pdev->dev, "No suitable DMA available.\n"); goto err_release_regions;