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: <20150827030740.GB4438@linux.intel.com>
Date:	Wed, 26 Aug 2015 21:07:40 -0600
From:	Ross Zwisler <ross.zwisler@...ux.intel.com>
To:	Toshi Kani <toshi.kani@...com>
Cc:	dan.j.williams@...el.com, rafael.j.wysocki@...el.com,
	linux-nvdimm@...ts.01.org, robert.moore@...el.com,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: Re: [PATCH 1/2]: nfit: Clarify memory device state flags strings

On Wed, Aug 26, 2015 at 10:20:23AM -0600, Toshi Kani wrote:
> diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> index c3fe206..6993ff2 100644
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
> @@ -701,12 +701,13 @@ static ssize_t flags_show(struct device *dev,
>  {
>  	u16 flags = to_nfit_memdev(dev)->flags;
>  
> -	return sprintf(buf, "%s%s%s%s%s\n",
> -			flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : "",
> -			flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore " : "",
> -			flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : "",
> -			flags & ACPI_NFIT_MEM_ARMED ? "arm " : "",
> -			flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart " : "");
> +	return sprintf(buf, "%s%s%s%s%s%s\n",
> +		flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
> +		flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail " : "",
> +		flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : "",
> +		flags & ACPI_NFIT_MEM_ARMED ? "not_arm " : "",

Assuming we do want to update these strings to be more friendly, "not_armed"
probably makes more sense than "not_arm".  Also applies to the 2nd hunk below.

> +		flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " : "",
> +		flags & ACPI_NFIT_MEM_HEALTH_ENABLED ? "notify_enabled " : "");
>  }
>  static DEVICE_ATTR_RO(flags);
>  
> @@ -834,11 +835,11 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
>  			continue;
>  
>  		dev_info(acpi_desc->dev, "%s: failed: %s%s%s%s\n",
> -				nvdimm_name(nvdimm),
> -			mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : "",
> -			mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore " : "",
> -			mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : "",
> -			mem_flags & ACPI_NFIT_MEM_ARMED ? "arm " : "");
> +		  nvdimm_name(nvdimm),
> +		  mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
> +		  mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail ":"",
> +		  mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : "",
> +		  mem_flags & ACPI_NFIT_MEM_ARMED ? "not_arm " : "");

While you're in here, is there a reason not to include the last two flags
(smart_event and notify_enabled) in this dev_info() output?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ