From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755400AbcDGI17 (ORCPT ); Thu, 7 Apr 2016 04:27:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:52961 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbcDGI14 convert rfc822-to-8bit (ORCPT ); Thu, 7 Apr 2016 04:27:56 -0400 From: Johannes Thumshirn To: linux-nvdimm@ml01.01.org Cc: Dan Williams , 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 Message-ID: <32455510.OFm6LAzW1p@c203> User-Agent: KMail/5.1.3 (Linux/4.5.0-2-default; KDE/5.20.0; x86_64; ; ) In-Reply-To: <20160407005349.30117.44157.stgit@dwillia2-desk3.jf.intel.com> References: <20160407005349.30117.44157.stgit@dwillia2-desk3.jf.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- [...] > @@ -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