Re: [PATCH v8] ufs: core: Add WB buffer resize support
From: Bean Huo
Date: Wed Apr 02 2025 - 04:51:23 EST
On Wed, 2025-04-02 at 15:57 +0800, Huan Tang wrote:
>
> +int ufshcd_wb_set_resize_en(struct ufs_hba *hba, u32 en_mode)
you must ensure the mode en_mode is within valid range (0-2), why not
use enum?
> +{
> + int ret;
> + u8 index;
> +
> + index = ufshcd_wb_get_query_index(hba);
> + ret = ufshcd_query_attr_retry(hba,
> UPIU_QUERY_OPCODE_WRITE_ATTR,
> + QUERY_ATTR_IDN_WB_BUF_RESIZE_EN,
> index, 0, &en_mode);
> + if (ret)
> + dev_err(hba->dev, "%s: Enable WB buf resize operation
> failed %d\n",
> + __func__, ret);
> +
> + return ret;
> +}