Re: [PATCH v5 2/2] scsi: ufs: core: Add support for static TX Equalization settings

From: Peter Wang (王信友)

Date: Fri May 29 2026 - 04:11:04 EST


On Thu, 2026-05-28 at 18:14 -0700, Can Guo wrote:
> +       for (i = 0; i < count; i++) {
> +               if (preshoot[i] >= TX_HS_NUM_PRESHOOT) {
>
>
> +       for (i = 0; i < count; i++) {
> +               if (deemphasis[i] >= TX_HS_NUM_DEEMPHASIS) {
>
> +                       for (i = 0; i < count; i++) {
> +                               if (precode_en[i] > 1) {
>

Hi Can,

I suggest using
for (i = 0; i < num_elems; i++) { ... }
instead of
for (i = 0; i < count; i++) { ... }
as it is more clear.

>
> +static void ufshcd_parse_static_tx_eq_settings(struct ufs_hba *hba)
> +{
> +       const u32 lpd = hba->lanes_per_direction;
> +       const u32 num_elems = lpd * 2;
> +       int gear;
> +
> +       if (!lpd) {
> +               return;
> +       } else if (lpd > UFS_MAX_LANES) {

Unnecessary else if after return.

The others look good to me.

Thanks.
Peter