Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932511AbcJRO3G (ORCPT ); Tue, 18 Oct 2016 10:29:06 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41818 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761620AbcJRO25 (ORCPT ); Tue, 18 Oct 2016 10:28:57 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 67B3561822 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=vivek.gautam@codeaurora.org From: Vivek Gautam To: kishon@ti.com, jejb@linux.vnet.ibm.com, vinholikatti@gmail.com, martin.petersen@oracle.com, linux-kernel@vger.kernel.org Cc: subhashj@codeaurora.org, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vivek Gautam Subject: [PATCH v2 02/10] phy: qcom-ufs: Remove unnecessary BUG_ON Date: Tue, 18 Oct 2016 19:58:09 +0530 Message-Id: <1476800897-19898-3-git-send-email-vivek.gautam@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476800897-19898-1-git-send-email-vivek.gautam@codeaurora.org> References: <1476800897-19898-1-git-send-email-vivek.gautam@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 953 Lines: 29 BUG_ON() are not preferred in the driver, plus the variable on which BUG_ON is asserted is already checked in the code before passing. Signed-off-by: Vivek Gautam Reviewed-by: Subhash Jadavani --- No change since v1. drivers/phy/phy-qcom-ufs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index 183ec04..805c91d 100644 --- a/drivers/phy/phy-qcom-ufs.c +++ b/drivers/phy/phy-qcom-ufs.c @@ -335,8 +335,6 @@ int ufs_qcom_phy_cfg_vreg(struct phy *phy, struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); struct device *dev = ufs_qcom_phy->dev; - BUG_ON(!vreg); - if (regulator_count_voltages(reg) > 0) { min_uV = on ? vreg->min_uV : 0; ret = regulator_set_voltage(reg, min_uV, vreg->max_uV); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project