[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b0ec5b8a-b303-4e5b-bca9-4524eba9fa31@acm.org>
Date: Tue, 20 May 2025 13:22:05 -0700
From: Bart Van Assche <bvanassche@....org>
To: Bean Huo <huobean@...il.com>, Huan Tang <tanghuan@...o.com>,
alim.akhtar@...sung.com, avri.altman@....com,
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 5/20/25 9:01 AM, Bean Huo wrote:
> 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"
> };
If this change is made, please use the designated initializer syntax
([label] = "text"). This will make it easier to verify that the
enumeration labels and the strings match.
Thanks,
Bart.
Powered by blists - more mailing lists