Re: [PATCH v2 1/7] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params

Andrew Halaney
2023-11-07T19:37:10Z

On Mon, Nov 06, 2023 at 08:46:07PM -0800, Can Guo wrote:
> From: Can Guo <quic_cang@quicinc.com>
>
> Structure ufs_dev_params is actually used in UFS host vendor drivers to
> declare host specific power mode parameters, like ufs_<vendor>_params or
> host_cap, which makes the code not very straightforward to read. Rename the
> structure ufs_dev_params to ufs_host_params and unify the declarations in
> all vendor drivers to host_params.
>
> In addition, rename the two functions ufshcd_init_dev_pwr_param() and

nit: s/ufshcd_init_dev_pwr_param/ufshcd_init_pwr_dev_param/

> ufshcd_get_dev_pwr_param() which work based on the ufs_host_params to

nit: s/ufshcd_get_dev_pwr_param/ufshcd_get_pwr_dev_param/

> ufshcd_init_host_param() and ufshcd_negotiate_pwr_param() respectively to
> avoid confusions.
>
> This change does not change any functionalities or logic.
>
> Signed-off-by: Can Guo <quic_cang@quicinc.com>
> ---
> drivers/ufs/host/ufs-exynos.c | 7 +++---
> drivers/ufs/host/ufs-hisi.c | 11 ++++-----
> drivers/ufs/host/ufs-mediatek.c | 12 ++++------
> drivers/ufs/host/ufs-qcom.c | 12 ++++------
> drivers/ufs/host/ufshcd-pltfrm.c | 49 ++++++++++++++++++++--------------------
> drivers/ufs/host/ufshcd-pltfrm.h | 10 ++++----
> 6 files changed, 47 insertions(+), 54 deletions(-)
>

<snip>

> diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
> index da2558e..6e65b61 100644
> --- a/drivers/ufs/host/ufshcd-pltfrm.c
> +++ b/drivers/ufs/host/ufshcd-pltfrm.c
> @@ -285,17 +285,17 @@ static int ufshcd_parse_operating_points(struct ufs_hba *hba)
> }
>
> /**
> - * ufshcd_get_pwr_dev_param - get finally agreed attributes for
> + * ufshcd_negotiate_pwr_param - get finally agreed attributes for
> * power mode change
> - * @pltfrm_param: pointer to platform parameters
> + * @host_param: pointer to platform parameters
> * @dev_max: pointer to device attributes
> * @agreed_pwr: returned agreed attributes
> *
> * Return: 0 on success, non-zero value on failure.
> */
> -int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *pltfrm_param,
> - const struct ufs_pa_layer_attr *dev_max,
> - struct ufs_pa_layer_attr *agreed_pwr)
> +int ufshcd_negotiate_pwr_param(const struct ufs_host_params *host_param,
> + const struct ufs_pa_layer_attr *dev_max,
> + struct ufs_pa_layer_attr *agreed_pwr)
> {
> int min_pltfrm_gear;

If you're going to change pltfrm -> host, maybe do so for
min_pltfrm_gear too? I think this all reads nicer with the functions
changed as is, but the consistency would be nice in my opinion.

Outside of those nits, I think this reads nicer now as well.

Acked-by: Andrew Halaney <ahalaney@redhat.com>