From patchwork Sat Mar 30 09:03:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Guangyue X-Patchwork-Id: 161493 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3026429jan; Sat, 30 Mar 2019 02:03:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZ41+NNruBZiydbT9fWdaXUxRVMUsxyK6Fz6TC9DZinj1p+iLKP7Cj0GfQmYQaS8xv/UvX X-Received: by 2002:a17:902:b94a:: with SMTP id h10mr25604946pls.82.1553936609162; Sat, 30 Mar 2019 02:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553936609; cv=none; d=google.com; s=arc-20160816; b=uJOrvEF+z4CNbq55Q5hMk8I2klIyN/g2TYwRTj5FRq3b45BjKFyJopMo+N0//x0FEn /wvYt/JNxCXnkObmdPakqvkNYexoXG56aK5+HaUEeVTjE8fVpu1LRBoVZye/QcCV7KwX 2oBdhzz2K9sQ2P3MZE2nXMy1VBisASji9WZXcT+6c6ZkXeu4AnoKzjncL7alEs4huMXJ Du16TReKRlfBKIuOn0sWR/ug4V+Ooa729i0jcQ6FygrNbMgT2oABeQZ2JFMzd7bw7nHP ifdwtlgCS/i/GBnzrCNfMt3k5HbL6clFOHp2Ma4mSmr/9vJZD2wEvJ33Iqt3kHedeIUM yGHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ynWh3mN37m+Uw53l1ar7HpLzDWRwKMVB6ZcbsRpGQdg=; b=m4LQO5M/h28D6VJ3ASVwxxwGb8dkdyvlCo184fMIE+10ZmOJ1qM0N/8sxczS1SEUGa MjBJo/ZhHtpYwdRnneuu2hiZmDJxpgBmors4+Fa9z+NdRaYlObgWxmRiPqxo6H+DtGjr gQjGUA8WZ/QnmQjHhYsVFTScJa0t1MixYRB7R3/ed7WLA8mFE7c144cjm57y3lb3vR5u 6fxj2l4I46yDmsTH5UY0zbB73xXYgOK+/u3zX+znFciKG072LImcxOd+Na1AU+LCDcFJ qrm8/lii6YfNjL16Pgb6hhGr1P6eIOICYT6/Z3kiOjZJaMueu40+ZHYnRy7pnjU2Jup6 eIlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si4077822plb.138.2019.03.30.02.03.28; Sat, 30 Mar 2019 02:03:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730388AbfC3JD2 (ORCPT + 1 other); Sat, 30 Mar 2019 05:03:28 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5765 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730354AbfC3JD2 (ORCPT ); Sat, 30 Mar 2019 05:03:28 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A85DF6DBD41A8DB5E493; Sat, 30 Mar 2019 17:03:24 +0800 (CST) Received: from PEK1000233773.huawei.com (10.178.175.169) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Sat, 30 Mar 2019 17:03:14 +0800 From: Zeng Guangyue To: , , , CC: , , Subject: [PATCH] scsi: ufs: remove unnecessary pointer judgement Date: Sat, 30 Mar 2019 17:03:13 +0800 Message-ID: <20190330090313.26291-1-zengguangyue@hisilicon.com> X-Mailer: git-send-email 2.20.1.309.g16a465bc01 MIME-Version: 1.0 X-Originating-IP: [10.178.175.169] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The pointer value is initialized as &hba->vreg_info, and it's never changed. It's not necessary to check the pointer is null or not. Signed-off-by: Zeng Guangyue --- drivers/scsi/ufs/ufshcd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) -- 2.20.1.309.g16a465bc01 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e040f9dd9ff3..f4a8931443b0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7103,9 +7103,6 @@ static int ufshcd_setup_vreg(struct ufs_hba *hba, bool on) struct device *dev = hba->dev; struct ufs_vreg_info *info = &hba->vreg_info; - if (!info) - goto out; - ret = ufshcd_toggle_vreg(dev, info->vcc, on); if (ret) goto out; @@ -7131,10 +7128,7 @@ static int ufshcd_setup_hba_vreg(struct ufs_hba *hba, bool on) { struct ufs_vreg_info *info = &hba->vreg_info; - if (info) - return ufshcd_toggle_vreg(hba->dev, info->vdd_hba, on); - - return 0; + return ufshcd_toggle_vreg(hba->dev, info->vdd_hba, on); } static int ufshcd_get_vreg(struct device *dev, struct ufs_vreg *vreg) @@ -7160,9 +7154,6 @@ static int ufshcd_init_vreg(struct ufs_hba *hba) struct device *dev = hba->dev; struct ufs_vreg_info *info = &hba->vreg_info; - if (!info) - goto out; - ret = ufshcd_get_vreg(dev, info->vcc); if (ret) goto out;