From patchwork Wed Jan 16 06:24:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Guangyue X-Patchwork-Id: 155695 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp288686jaa; Tue, 15 Jan 2019 22:24:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ag7iwI6AMCt2t4KeQViM5sH6BeeXysrWxqPw9tMiLTscxACRO/nAz3PNVE672MYDo1Jgb X-Received: by 2002:a62:15d5:: with SMTP id 204mr8201569pfv.103.1547619896494; Tue, 15 Jan 2019 22:24:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547619896; cv=none; d=google.com; s=arc-20160816; b=vG2YEaYMsHj9mJO3wYV5SnRmTy6v3t3+uuSmRL58CMJDIW2jVvyeXfwDz/tK3FDg25 Gid2Yt2fvGXAbG4deVdjYRZU6j9dXK+RHaTkmeYCIjjvrjHk9ZIdzTpwFJF9M8KRStAA d5gzCTI6uryp9+mXPlD0TDfH8pcgVLf5aptFC/JS2JwfyoRT3IvdKr1dc5iV1dJyZ1O9 T3lLyfQcUYnXGC6crjFrE6gYmi0R8sDsX2HuG65tVjnTmIgK0pFfYx+pR5a5izCQQiDM Xaxuza8ZqPcseybTyqsFAVjdGw4c39H3bM35nD6edRX2Mf+brVh+yDG1b5EZt+cnz0r3 a9iA== 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=LKLJJ0PsXwKBDpG/8OShS/o/8332H2zAKB19dvFjAi0=; b=ZWnVTn/yZTLG+CKdOnhz1gnPDexZIhnq8Gbu/DWMamwOh3fdm9SzQMkP/4BU9qWz+d StVN1GqF0kZyzbX+yyPKrnJ0lSfYC6XSpk6ep16510VJ3x21Lw12cv+fxle0u8YD+D4m aplg4/aZY88FVKrjJciCZNIollPECBppRVSA9TSIOvDoYsv0tqK5bEoq2R99U0qfIKMh h4+0e00a/Y6O6SnQJukpGmk+ehr6mpwmJAt4JyMeJMdBUHoOM5Nwme8HYb3NR+rgRW5M 91STljUHSvrRF1BNbBonWJFdGGyWoo3DDpLotzawMHz9HQ2Jc7UbzxZN/MBfkHXJ2Qdg LhKA== 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 c26si5219189pgm.210.2019.01.15.22.24.56; Tue, 15 Jan 2019 22:24:56 -0800 (PST) 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 S2387513AbfAPGYz (ORCPT + 1 other); Wed, 16 Jan 2019 01:24:55 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:46102 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387456AbfAPGYz (ORCPT ); Wed, 16 Jan 2019 01:24:55 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8A5E21A916DC9F0B22A4; Wed, 16 Jan 2019 14:24:53 +0800 (CST) Received: from u107-84.huawei.com (10.141.107.84) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Wed, 16 Jan 2019 14:24:45 +0800 From: To: , , , CC: , Subject: [PATCH] coresight: not judge pointer Date: Wed, 16 Jan 2019 14:24:44 +0800 Message-ID: <20190116062444.92031-1-zengguangyue@hisilicon.com> X-Mailer: git-send-email 2.20.GIT MIME-Version: 1.0 X-Originating-IP: [10.141.107.84] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: z00486613 As a member of struct ufs_hba, the &hba->vreg_info will never be null, so there is no need the judge the pointer is null or not. Signed-off-by: z00486613 --- drivers/scsi/ufs/ufshcd.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 2.20.GIT diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 9ba7671b84f8..c729a9969aec 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7109,9 +7109,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; @@ -7137,10 +7134,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) @@ -7166,9 +7160,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; @@ -7197,9 +7188,7 @@ static int ufshcd_set_vccq_rail_unused(struct ufs_hba *hba, bool unused) int ret = 0; struct ufs_vreg_info *info = &hba->vreg_info; - if (!info) - goto out; - else if (!info->vccq) + if (!info->vccq) goto out; if (unused) {