From: "Kusiak, Mateusz" <mateusz.kusiak@linux.intel.com>
To: Coly Li <colyli@suse.de>, Mateusz Kusiak <mateusz.kusiak@intel.com>
Cc: linux-raid <linux-raid@vger.kernel.org>,
Jes Sorensen <jes@trained-monkey.org>
Subject: Re: [PATCH 07/10] super-intel: refactor the code for enum
Date: Thu, 22 Sep 2022 13:22:11 +0200 [thread overview]
Message-ID: <4c03c96d-8689-9a3b-e6aa-a2eb7bd06e2c@linux.intel.com> (raw)
In-Reply-To: <78011938-BC68-4E12-BD0A-F49F1EE6FA65@suse.de>
On 14/09/2022 17:03, Coly Li wrote:
>
>
>> 2022年8月18日 22:56,Mateusz Kusiak <mateusz.kusiak@intel.com> 写道:
>>
>> It prepares super-intel for change context->update to enum.
>>
>> Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
>> ---
>> super-intel.c | 38 +++++++++++++++++++++++++-------------
>> 1 file changed, 25 insertions(+), 13 deletions(-)
>>
>> diff --git a/super-intel.c b/super-intel.c
>> index 672f946e..3de3873e 100644
>> --- a/super-intel.c
>> +++ b/super-intel.c
>> @@ -3930,7 +3930,8 @@ static int update_super_imsm(struct supertype *st, struct mdinfo *info,
>>
>> mpb = super->anchor;
>>
>> - if (strcmp(update, "uuid") == 0) {
>> + switch (map_name(update_options, update)) {
>> + case UOPT_UUID:
>> /* We take this to mean that the family_num should be updated.
>> * However that is much smaller than the uuid so we cannot really
>> * allow an explicit uuid to be given. And it is hard to reliably
>> @@ -3954,10 +3955,14 @@ static int update_super_imsm(struct supertype *st, struct mdinfo *info,
>> }
>> if (rv == 0)
>> mpb->orig_family_num = info->uuid[0];
>> - } else if (strcmp(update, "assemble") == 0)
>> + break;
>> + case UOPT_SPEC_ASSEMBLE:
>> rv = 0;
>> - else
>> + break;
>> + default:
>> rv = -1;
>> + break;
>> + }
>>
>> /* successful update? recompute checksum */
>> if (rv == 0)
>> @@ -7888,18 +7893,25 @@ static int kill_subarray_imsm(struct supertype *st, char *subarray_id)
>>
>> return 0;
>> }
>> -
>> -static int get_rwh_policy_from_update(char *update)
>> +/**
>> + * get_rwh_policy_from_update() - Get the rwh policy for update option.
>> + * @update: Update option.
>> + */
>
>
> The above comment format is not the existed code comments style.
>
> For example for getinfo_super_disks_imsm() in same file,
>
> 3862 /* allocates memory and fills disk in mdinfo structure
> 3863 * for each disk in array */
> 3864 struct mdinfo *getinfo_super_disks_imsm(struct supertype *st)
>
I believe it matches kernel style descriptions, like in
imsm_get_free_size(). I can add "Return" part if you want me to.
I just noticed that empty line is missing before the function
description, I'll fix this in v2.
>
> [snipped]
>
> The rested part is fine to me.
>
> Thanks.
>
> Coly Li
next prev parent reply other threads:[~2022-09-22 11:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 14:56 [PATCH 00/10] Block update-subarray and refactor context update Mateusz Kusiak
2022-08-18 14:56 ` [PATCH 01/10] mdadm: Add option validation for --update-subarray Mateusz Kusiak
2022-09-13 15:12 ` Coly Li
2022-09-22 11:21 ` Kusiak, Mateusz
2022-08-18 14:56 ` [PATCH 02/10] Fix --update-subarray on active volume Mateusz Kusiak
2022-09-14 15:02 ` Coly Li
2022-08-18 14:56 ` [PATCH 03/10] Add code specific update options to enum Mateusz Kusiak
2022-09-14 15:02 ` Coly Li
2022-08-18 14:56 ` [PATCH 04/10] super-ddf: Remove update_super_ddf Mateusz Kusiak
2022-09-14 15:03 ` Coly Li
2022-08-18 14:56 ` [PATCH 05/10] super0: refactor the code for enum Mateusz Kusiak
2022-09-14 15:03 ` Coly Li
2022-09-22 11:21 ` Kusiak, Mateusz
2022-09-22 18:20 ` Jes Sorensen
2022-08-18 14:56 ` [PATCH 06/10] super1: " Mateusz Kusiak
2022-09-14 15:03 ` Coly Li
2022-09-22 11:21 ` Kusiak, Mateusz
2022-12-28 14:29 ` Jes Sorensen
2022-08-18 14:56 ` [PATCH 07/10] super-intel: " Mateusz Kusiak
2022-09-14 15:03 ` Coly Li
2022-09-22 11:22 ` Kusiak, Mateusz [this message]
2022-08-18 14:56 ` [PATCH 08/10] Change update to enum in update_super and update_subarray Mateusz Kusiak
2022-09-03 5:57 ` Coly Li
2022-09-14 15:03 ` Coly Li
2022-09-22 11:22 ` Kusiak, Mateusz
2022-08-18 14:56 ` [PATCH 09/10] Manage&Incremental: code refactor, string to enum Mateusz Kusiak
2022-09-14 15:03 ` Coly Li
2022-08-18 14:56 ` [PATCH 10/10] Change char* to enum in context->update & refactor code Mateusz Kusiak
2022-09-14 15:03 ` Coly Li
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=4c03c96d-8689-9a3b-e6aa-a2eb7bd06e2c@linux.intel.com \
--to=mateusz.kusiak@linux.intel.com \
--cc=colyli@suse.de \
--cc=jes@trained-monkey.org \
--cc=linux-raid@vger.kernel.org \
--cc=mateusz.kusiak@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.