Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1468981ybi; Sat, 25 May 2019 02:43:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNYux2438zoX87Xwl/6muSEAWxLtqLikj+ER5LTHrQo2xg7Ca5tDMP1KY+PH3iNSynGc25 X-Received: by 2002:a65:6497:: with SMTP id e23mr18966887pgv.388.1558777418830; Sat, 25 May 2019 02:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558777418; cv=none; d=google.com; s=arc-20160816; b=s0gIffs1kc8Ux6X5KywAXOCX0EFtdheTsfmwdbcgDj+4gXcJGG14M5yMpQBFCTywAt f55Q+LZ/KVw0lkLAkjryx2TL9RP6LTzGLJw2PBYx0YbIi1+KpJP2FBGvSrERrqc4YBHO xW8IXfpVPLT8Rt1E12WqXhArjoQUZXLmNRgWR71IgcFAuAx5rJM4tUXk/Wb2DReCz/V6 P83Kyxgzip0kcOZMEsBW/2dNOEbKuR3TeDufkrB1iT+yS7FuKafCMn23YjWe/5S1Ni5s O5XeAnLBya/lCuNXkiLUttbME9QpJF22NcHobr/yO9VDYEELBIFrZRClfwCPaj3zgTSL aJlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=QUf7j2G4TR/XOjAVHKTk85Pmwvoby3ulkAqwU+DbaeM=; b=jMqxN1RkqrDzPUbAFLw9YMAGLmfSM1/UgHFaKfVWY6noWb2K+pLluPG/xNSbPJaGFR m7fhRWlJ3sCqyZ0KAXY2u8Vp/q6RfxgZE6PhU9SjduuGaURp5RWMBYbv6XvZNLqCqM3v z85W1UviQiasV6YHP7hmJAOlbhbOoxRoIYXuJ3XEPvibdvs0wP6ISR6wnbwrZvyEwRD9 WdO6ivlgVxRi0aWJy+5oq6nMoOYBA/BDTLBgtjWgAg1I4GvwJ79O2fy74gbrXmGTpyC/ p5fnMhTzWTTMwdoMbC49V/0F0ahWtsYjTxUopBDrz0VYgXT8Wb0WXu2CMHizsefPU+IS 0qKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=REliOAXh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t76si8470391pfa.110.2019.05.25.02.43.23; Sat, 25 May 2019 02:43:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=REliOAXh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726793AbfEYJmO (ORCPT + 99 others); Sat, 25 May 2019 05:42:14 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46926 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbfEYJmO (ORCPT ); Sat, 25 May 2019 05:42:14 -0400 Received: by mail-pf1-f195.google.com with SMTP id y11so1902816pfm.13; Sat, 25 May 2019 02:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=QUf7j2G4TR/XOjAVHKTk85Pmwvoby3ulkAqwU+DbaeM=; b=REliOAXhJoRKu38PvPanSiAGUDtQmN8dOojq6O2bxDriGcZWhamrlztq9Pe9Dni+KU g9HXu8RBPi+lHPuNKZk9XSimyK+iRDAxG1wFrZmnEMT+mPiHEe2HEDDT8vXiI+zLn+bY hqddB9ZRkBpt79BiGvOtuA3GThoCqOZBga5n62TiXsOYxjCrV9W+efsvegDy4iYQ68Cz j4vtf/mqN3DuosjzWjNsnv+rzZYAKZibfTu2Dx653dBzmGme42yvIOUKdRDPn2wSRDXN 1UPi47lI/gRbLr/xQEvzsXWESPPecx4SvXkrbWtIJp2TKmBzXAx5Msk5tbaOUg8jWZf/ r0LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=QUf7j2G4TR/XOjAVHKTk85Pmwvoby3ulkAqwU+DbaeM=; b=GY26m7XHnWzAIV+8xgmYjcB6Ki6zUs+FaGh2j1mUhccSi4mO6O22aKfjCYuGqydy49 9UiX27LVdLcIXTHrx+MQUPnoMIf8HsPM0RMigndzLQXFig/DsD60B4xJ9Jp6sb+dXiDL 0t7QRkIZ8Sl/QNdNAPisXpOYTjaKKfJLqRVXQJso87CQwS44DV7G6Rxhssor13Yz+sbl DpxifIK00hPccxcRbkC+HmyJttCRz6D5nYQ8GSjY1f13mg4tuukBNRr/42O/cAsEpv59 vkd2EvP8NR5KbmR4qkn8RyHNfr5FIMxfwxtspvSOqXp1AEKWn6Fiyc/e7s3l0XtQoPpF Ho7g== X-Gm-Message-State: APjAAAXFX2766WAN1i/udmmuCe/g8sW/uWzoyL62XKFRsvILJlct+mH7 mOfb7d0hAUjLFB0clB3ePdo= X-Received: by 2002:a63:8449:: with SMTP id k70mr109311997pgd.53.1558777333777; Sat, 25 May 2019 02:42:13 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.73]) by smtp.gmail.com with ESMTPSA id r3sm5186846pgn.12.2019.05.25.02.42.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 May 2019 02:42:13 -0700 (PDT) Date: Sat, 25 May 2019 15:12:05 +0530 From: Hariprasad Kelam To: qla2xxx-upstream@qlogic.com, "James E.J. Bottomley" , "Martin K. Petersen" , Alim Akhtar , Avri Altman , Pedro Sousa , Wei Li , Geng Jianfeng , Zang Leigang , Stanley Chu , Hariprasad Kelam , Manivannan Sadhasivam , Kangjie Lu , Arnd Bergmann , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/scsi: fix warning PTR_ERR_OR_ZERO can be used Message-ID: <20190525094205.GA21778@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix below warnig reported by coccicheck /drivers/scsi/ufs/ufs-hisi.c:459:1-3: WARNING: PTR_ERR_OR_ZERO can be used ./drivers/scsi/qla2xxx/tcm_qla2xxx.c:1477:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Hariprasad Kelam --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 +--- drivers/scsi/ufs/ufs-hisi.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index ec9f199..4357b34 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1474,10 +1474,8 @@ static int tcm_qla2xxx_check_initiator_node_acl( sizeof(struct qla_tgt_cmd), TARGET_PROT_ALL, port_name, qlat_sess, tcm_qla2xxx_session_cb); - if (IS_ERR(se_sess)) - return PTR_ERR(se_sess); - return 0; + return PTR_ERR_OR_ZERO(se_sess); } static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id, diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c index 7aed0a1..f506044 100644 --- a/drivers/scsi/ufs/ufs-hisi.c +++ b/drivers/scsi/ufs/ufs-hisi.c @@ -456,10 +456,8 @@ static int ufs_hisi_get_resource(struct ufs_hisi_host *host) /* get resource of ufs sys ctrl */ mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); host->ufs_sys_ctrl = devm_ioremap_resource(dev, mem_res); - if (IS_ERR(host->ufs_sys_ctrl)) - return PTR_ERR(host->ufs_sys_ctrl); - return 0; + return PTR_ERR_OR_ZERO(host->ufs_sys_ctrl); } static void ufs_hisi_set_pm_lvl(struct ufs_hba *hba) -- 2.7.4