From: Bart Van Assche <bvanassche@acm.org>
To: Bean Huo <huobean@gmail.com>, Huan Tang <tanghuan@vivo.com>,
alim.akhtar@samsung.com, avri.altman@wdc.com,
James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com, peter.wang@mediatek.com,
manivannan.sadhasivam@linaro.org, quic_nguyenb@quicinc.com,
luhongfei@vivo.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Cc: opensource.kernel@vivo.com, Wenxing Cheng <wenxing.cheng@vivo.com>
Subject: Re: [PATCH v5] ufs: core: Add HID support
Date: Tue, 20 May 2025 13:22:05 -0700 [thread overview]
Message-ID: <b0ec5b8a-b303-4e5b-bca9-4524eba9fa31@acm.org> (raw)
In-Reply-To: <32c36b58dcdbb09403fa9dccff28b6bee76882e0.camel@gmail.com>
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.
next prev parent reply other threads:[~2025-05-20 20:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 9:40 [PATCH v5] ufs: core: Add HID support Huan Tang
2025-05-20 13:14 ` Peter Wang (王信友)
2025-05-20 20:13 ` Bart Van Assche
2025-05-21 2:22 ` Peter Wang (王信友)
2025-05-21 14:33 ` Huan Tang
2025-05-22 3:26 ` Peter Wang (王信友)
2025-05-20 16:01 ` Bean Huo
2025-05-20 20:22 ` Bart Van Assche [this message]
2025-05-21 14:32 ` Huan Tang
2025-05-21 14:56 ` Bean Huo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0ec5b8a-b303-4e5b-bca9-4524eba9fa31@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=avri.altman@wdc.com \
--cc=huobean@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=luhongfei@vivo.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=opensource.kernel@vivo.com \
--cc=peter.wang@mediatek.com \
--cc=quic_nguyenb@quicinc.com \
--cc=tanghuan@vivo.com \
--cc=wenxing.cheng@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).