diff mbox series

scsi: ufs: qcom: remove unnecessary check

Message ID fe3b8fcd-64a7-4887-bddd-32239a88a6a3@moroto.mountain (mailing list archive)
State Not Applicable
Headers show
Series scsi: ufs: qcom: remove unnecessary check | expand

Commit Message

Dan Carpenter Oct. 2, 2023, 7:03 a.m. UTC
The "attr" pointer points to an offset into the "host" struct so it
can't be NULL.  Delete the if statement and pull the code in a tab.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/ufs/host/ufs-qcom.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

Comments

Martin K. Petersen Oct. 10, 2023, 1:53 a.m. UTC | #1
Dan,

> The "attr" pointer points to an offset into the "host" struct so it
> can't be NULL. Delete the if statement and pull the code in a tab.

Applied to 6.7/scsi-staging, thanks!
Manivannan Sadhasivam Oct. 10, 2023, 12:21 p.m. UTC | #2
On Mon, Oct 02, 2023 at 10:03:35AM +0300, Dan Carpenter wrote:
> The "attr" pointer points to an offset into the "host" struct so it
> can't be NULL.  Delete the if statement and pull the code in a tab.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/ufs/host/ufs-qcom.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 2128db0293b5..96cb8b5b4e66 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1447,15 +1447,11 @@ static int ufs_qcom_clk_scale_up_pre_change(struct ufs_hba *hba)
>  	if (!ufs_qcom_cap_qunipro(host))
>  		return 0;
>  
> -	if (attr) {
> -		ret = ufs_qcom_cfg_timers(hba, attr->gear_rx,
> -					attr->pwr_rx, attr->hs_rate,
> -					false, true);
> -		if (ret) {
> -			dev_err(hba->dev, "%s ufs cfg timer failed\n",
> -						__func__);
> -			return ret;
> -		}
> +	ret = ufs_qcom_cfg_timers(hba, attr->gear_rx, attr->pwr_rx,
> +				  attr->hs_rate, false, true);
> +	if (ret) {
> +		dev_err(hba->dev, "%s ufs cfg timer failed\n", __func__);
> +		return ret;
>  	}
>  	/* set unipro core clock attributes and clear clock divider */
>  	return ufs_qcom_set_core_clk_ctrl(hba, true);
> -- 
> 2.39.2
>
Martin K. Petersen Oct. 13, 2023, 9:03 p.m. UTC | #3
On Mon, 02 Oct 2023 10:03:35 +0300, Dan Carpenter wrote:

> The "attr" pointer points to an offset into the "host" struct so it
> can't be NULL.  Delete the if statement and pull the code in a tab.
> 
> 

Applied to 6.7/scsi-queue, thanks!

[1/1] scsi: ufs: qcom: remove unnecessary check
      https://git.kernel.org/mkp/scsi/c/b6f2e063017b
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 2128db0293b5..96cb8b5b4e66 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1447,15 +1447,11 @@  static int ufs_qcom_clk_scale_up_pre_change(struct ufs_hba *hba)
 	if (!ufs_qcom_cap_qunipro(host))
 		return 0;
 
-	if (attr) {
-		ret = ufs_qcom_cfg_timers(hba, attr->gear_rx,
-					attr->pwr_rx, attr->hs_rate,
-					false, true);
-		if (ret) {
-			dev_err(hba->dev, "%s ufs cfg timer failed\n",
-						__func__);
-			return ret;
-		}
+	ret = ufs_qcom_cfg_timers(hba, attr->gear_rx, attr->pwr_rx,
+				  attr->hs_rate, false, true);
+	if (ret) {
+		dev_err(hba->dev, "%s ufs cfg timer failed\n", __func__);
+		return ret;
 	}
 	/* set unipro core clock attributes and clear clock divider */
 	return ufs_qcom_set_core_clk_ctrl(hba, true);