lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32c36b58dcdbb09403fa9dccff28b6bee76882e0.camel@gmail.com>
Date: Tue, 20 May 2025 18:01:50 +0200
From: Bean Huo <huobean@...il.com>
To: Huan Tang <tanghuan@...o.com>, alim.akhtar@...sung.com,
 avri.altman@....com,  bvanassche@....org,
 James.Bottomley@...senPartnership.com,  martin.petersen@...cle.com,
 matthias.bgg@...il.com,  angelogioacchino.delregno@...labora.com,
 peter.wang@...iatek.com,  manivannan.sadhasivam@...aro.org,
 quic_nguyenb@...cinc.com, luhongfei@...o.com,  linux-scsi@...r.kernel.org,
 linux-kernel@...r.kernel.org,  linux-arm-kernel@...ts.infradead.org,
 linux-mediatek@...ts.infradead.org
Cc: opensource.kernel@...o.com, Wenxing Cheng <wenxing.cheng@...o.com>
Subject: Re: [PATCH v5] ufs: core: Add HID support

On Tue, 2025-05-20 at 17:40 +0800, Huan Tang wrote:
> @@ -87,6 +87,26 @@ static const char *ufs_wb_resize_status_to_string(enum wb_resize_status status)
>         }
>  }
>  
> +static const char *ufs_hid_state_to_string(enum ufs_hid_state state)
> +{
> +       switch (state) {
> +       case HID_IDLE:
> +               return "idle";
> +       case ANALYSIS_IN_PROGRESS:
> +               return "analysis_in_progress";
> +       case DEFRAG_REQUIRED:
> +               return "defrag_required";
> +       case DEFRAG_IN_PROGRESS:
> +               return "defrag_in_progress";
> +       case DEFRAG_COMPLETED:
> +               return "defrag_completed";
> +       case DEFRAG_NOT_REQUIRED:
> +               return "defrag_not_required";
> +       default:
> +               return "unknown";
> +       }
> +}

The enum ufs_hid_state values are contiguous and start from 0, maybe change switch-state to :

#define NUM_UFS_HID_STATES 6
static const char *ufs_hid_states[NUM_UFS_HID_STATES] = {
    "idle",
    "analysis_in_progress",
    "defrag_required",
    "defrag_in_progress",
    "defrag_completed",
    "defrag_not_required"
};

static const char *ufs_hid_state_to_string(enum ufs_hid_state state) {
    if ((unsigned int)state < NUM_UFS_HID_STATES)
        return ufs_hid_states[state];
    return "unknown";
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ