Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1373554

Re: [PATCH] libnvdimm, test: add mock SMART data payload

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] libnvdimm, test: add mock SMART data payload
Date 2016-04-07 18:50 +0200
Message-ID <rlli3-6NG-35@gated-at.bofh.it> (permalink)
References <rl6sG-3TK-11@gated-at.bofh.it> <rldub-10J-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 7, 2016 at 1:27 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> 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?

Can't use BIT() since that definition isn't exported in a user header.
I don't have a strong opinion of #define vs anonymous enum, I'll go
ahead and switch it over.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] libnvdimm, test: add mock SMART data payload Dan Williams <dan.j.williams@intel.com> - 2016-04-07 03:00 +0200
  Re: [PATCH] libnvdimm, test: add mock SMART data payload Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-07 10:30 +0200
    Re: [PATCH] libnvdimm, test: add mock SMART data payload Dan Williams <dan.j.williams@intel.com> - 2016-04-07 18:50 +0200
  [PATCH v2] libnvdimm, test: add mock SMART data payload Dan Williams <dan.j.williams@intel.com> - 2016-04-08 00:40 +0200
    Re: [PATCH v2] libnvdimm, test: add mock SMART data payload Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-08 09:30 +0200

csiph-web