public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: linux-nvdimm@lists.01.org
Cc: Dan Williams <dan.j.williams@intel.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] libnvdimm, test: add mock SMART data payload
Date: Thu, 07 Apr 2016 10:27:54 +0200	[thread overview]
Message-ID: <32455510.OFm6LAzW1p@c203> (raw)
In-Reply-To: <20160407005349.30117.44157.stgit@dwillia2-desk3.jf.intel.com>

On Mittwoch, 6. April 2016 17:53:49 CEST Dan Williams wrote:
> Provide simulated SMART data to enable the ndctl implementation of SMART
> data retrieval and parsing.
> 
> The payload is defined here, "Section 4.1 SMART and Health Info
> (Function Index 1)":
> 
>     http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---

[...]

> @@ -20,6 +20,35 @@ struct nd_cmd_smart {
>  	__u8 data[128];
>  } __packed;
> 
> +enum {
> +	ND_SMART_HEALTH_VALID	= 1 << 0,
> +	ND_SMART_TEMP_VALID 	= 1 << 1,
> +	ND_SMART_SPARES_VALID	= 1 << 2,
> +	ND_SMART_ALARM_VALID	= 1 << 3,
> +	ND_SMART_USED_VALID	= 1 << 4,
> +	ND_SMART_SHUTDOWN_VALID	= 1 << 5,
> +	ND_SMART_VENDOR_VALID	= 1 << 6,
> +	ND_SMART_TEMP_TRIP	= 1 << 0,
> +	ND_SMART_SPARE_TRIP	= 1 << 1,
> +	ND_SMART_NON_CRITICAL_HEALTH	= 1 << 0,
> +	ND_SMART_CRITICAL_HEALTH	= 1 << 1,
> +	ND_SMART_FATAL_HEALTH		= 1 << 2,
> +};

Why not use BIT() instead of that 1 << x stuff and #define instead of the 
abstract enum?

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-04-07  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07  0:53 [PATCH] libnvdimm, test: add mock SMART data payload Dan Williams
2016-04-07  8:27 ` Johannes Thumshirn [this message]
2016-04-07 16:41   ` Dan Williams
2016-04-07 22:32 ` [PATCH v2] " Dan Williams
2016-04-08  7:27   ` Johannes Thumshirn

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=32455510.OFm6LAzW1p@c203 \
    --to=jthumshirn@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    /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