diff mbox

[07/11] ndctl: update dimm flag names

Message ID 20150905013153.28464.64571.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Dan Williams Sept. 5, 2015, 1:31 a.m. UTC
It is important for the flag names to be explicit about their polarity
as feedback to a firmware implementer to get the polarity correct.
Update to keep in sync with the kernel rename.

Cc: Robert Elliott <elliott@hp.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Linda Knippers <linda.knippers@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 lib/libndctl.c      |   10 +++++-----
 lib/test-libndctl.c |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Kani, Toshi Sept. 8, 2015, 6:29 p.m. UTC | #1
On Fri, 2015-09-04 at 21:31 -0400, Dan Williams wrote:
> It is important for the flag names to be explicit about their polarity
> as feedback to a firmware implementer to get the polarity correct.
> Update to keep in sync with the kernel rename.
> 
> Cc: Robert Elliott <elliott@hp.com>
> Cc: Toshi Kani <toshi.kani@hp.com>
> Cc: Linda Knippers <linda.knippers@hp.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  lib/libndctl.c      |   10 +++++-----
>  lib/test-libndctl.c |    4 ++--
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/libndctl.c b/lib/libndctl.c
> index d08cf0812f50..d85453a3ac63 100644
> --- a/lib/libndctl.c
> +++ b/lib/libndctl.c
> @@ -839,15 +839,15 @@ static void parse_nfit_mem_flags(struct ndctl_dimm
> *dimm, char *flags)
>  	start = flags;
>  	while ((end = strchr(start, ' '))) {
>  		*end = '\0';
> -		if (strcmp(start, "arm") == 0)
> +		if (strcmp(start, "not_armed") == 0)
>  			dimm->f_arm = 1;
> -		else if (strcmp(start, "save") == 0)
> +		else if (strcmp(start, "save_fail") == 0)
>  			dimm->f_save = 1;
> -		else if (strcmp(start, "flush") == 0)
> +		else if (strcmp(start, "flush_fail") == 0)
>  			dimm->f_flush = 1;
> -		else if (strcmp(start, "smart") == 0)
> +		else if (strcmp(start, "smart_event") == 0)
>  			dimm->f_smart = 1;
> -		else if (strcmp(start, "restore") == 0)
> +		else if (strcmp(start, "restore_fail") == 0)
>  			dimm->f_restore = 1;

Should the fprintf strings in check_dimms() also be changed as well?

Thanks,
-Toshi
Dan Williams Sept. 8, 2015, 9:15 p.m. UTC | #2
On Tue, Sep 8, 2015 at 11:29 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> On Fri, 2015-09-04 at 21:31 -0400, Dan Williams wrote:
>> It is important for the flag names to be explicit about their polarity
>> as feedback to a firmware implementer to get the polarity correct.
>> Update to keep in sync with the kernel rename.
>>
>> Cc: Robert Elliott <elliott@hp.com>
>> Cc: Toshi Kani <toshi.kani@hp.com>
>> Cc: Linda Knippers <linda.knippers@hp.com>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>> ---
>>  lib/libndctl.c      |   10 +++++-----
>>  lib/test-libndctl.c |    4 ++--
>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/lib/libndctl.c b/lib/libndctl.c
>> index d08cf0812f50..d85453a3ac63 100644
>> --- a/lib/libndctl.c
>> +++ b/lib/libndctl.c
>> @@ -839,15 +839,15 @@ static void parse_nfit_mem_flags(struct ndctl_dimm
>> *dimm, char *flags)
>>       start = flags;
>>       while ((end = strchr(start, ' '))) {
>>               *end = '\0';
>> -             if (strcmp(start, "arm") == 0)
>> +             if (strcmp(start, "not_armed") == 0)
>>                       dimm->f_arm = 1;
>> -             else if (strcmp(start, "save") == 0)
>> +             else if (strcmp(start, "save_fail") == 0)
>>                       dimm->f_save = 1;
>> -             else if (strcmp(start, "flush") == 0)
>> +             else if (strcmp(start, "flush_fail") == 0)
>>                       dimm->f_flush = 1;
>> -             else if (strcmp(start, "smart") == 0)
>> +             else if (strcmp(start, "smart_event") == 0)
>>                       dimm->f_smart = 1;
>> -             else if (strcmp(start, "restore") == 0)
>> +             else if (strcmp(start, "restore_fail") == 0)
>>                       dimm->f_restore = 1;
>
> Should the fprintf strings in check_dimms() also be changed as well?
>

Yes, for consistency, will fix.  Thanks Toshi!
diff mbox

Patch

diff --git a/lib/libndctl.c b/lib/libndctl.c
index d08cf0812f50..d85453a3ac63 100644
--- a/lib/libndctl.c
+++ b/lib/libndctl.c
@@ -839,15 +839,15 @@  static void parse_nfit_mem_flags(struct ndctl_dimm *dimm, char *flags)
 	start = flags;
 	while ((end = strchr(start, ' '))) {
 		*end = '\0';
-		if (strcmp(start, "arm") == 0)
+		if (strcmp(start, "not_armed") == 0)
 			dimm->f_arm = 1;
-		else if (strcmp(start, "save") == 0)
+		else if (strcmp(start, "save_fail") == 0)
 			dimm->f_save = 1;
-		else if (strcmp(start, "flush") == 0)
+		else if (strcmp(start, "flush_fail") == 0)
 			dimm->f_flush = 1;
-		else if (strcmp(start, "smart") == 0)
+		else if (strcmp(start, "smart_event") == 0)
 			dimm->f_smart = 1;
-		else if (strcmp(start, "restore") == 0)
+		else if (strcmp(start, "restore_fail") == 0)
 			dimm->f_restore = 1;
 		start = end + 1;
 	}
diff --git a/lib/test-libndctl.c b/lib/test-libndctl.c
index c2e7bc7b4ff4..ec03ad439d55 100644
--- a/lib/test-libndctl.c
+++ b/lib/test-libndctl.c
@@ -1471,8 +1471,8 @@  static int check_dimms(struct ndctl_bus *bus, struct dimm *dimms, int n,
 		if (ndctl_dimm_has_errors(dimm) != !!dimms[i].flags) {
 			fprintf(stderr, "bus: %s dimm%d %s expected%s errors\n",
 					ndctl_bus_get_provider(bus), i,
-					dimms[i].flags ? "" : " no",
-					ndctl_dimm_get_devname(dimm));
+					ndctl_dimm_get_devname(dimm),
+					dimms[i].flags ? "" : " no");
 			return -ENXIO;
 		}