Message ID | 20150910231253.33942.70223.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 46ed7cfc9ade |
Headers | show |
On Thu, 2015-09-10 at 19:13 -0400, Dan Williams wrote: > ...to eliminate these warnings when falling back to the local > ndctl.h. > > In file included from lib/test-parent-uuid.c:36:0: > ./ndctl.h: In function ‘nvdimm_bus_cmd_name’: > ./ndctl.h:127:2: warning: implicit declaration of function > ‘ARRAY_SIZE’ [-Wimplicit-function-declaration] > if (cmd < ARRAY_SIZE(names) && names[cmd]) > ^ > ./ndctl.h:127:2: warning: nested extern declaration of ‘ARRAY_SIZE’ [ > -Wnested-externs] > ./ndctl.h:127:10: warning: comparison between signed and unsigned > integer expressions [-Wsign-compare] > if (cmd < ARRAY_SIZE(names) && names[cmd]) > ^ > ./ndctl.h: In function ‘nvdimm_cmd_name’: > ./ndctl.h:146:10: warning: comparison between signed and unsigned > integer expressions [-Wsign-compare] > if (cmd < ARRAY_SIZE(names) && names[cmd]) > ^ > > Cc: Vishal Verma <vishal.l.verma@intel.com> > Signed-off-by: Dan Williams <dan.j.williams@intel.com> > --- > lib/test-parent-uuid.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) Acked-by: Vishal Verma <vishal.l.verma@intel.com> > > diff --git a/lib/test-parent-uuid.c b/lib/test-parent-uuid.c > index a9d7eb1ec2dc..ed0e7f88863b 100644 > --- a/lib/test-parent-uuid.c > +++ b/lib/test-parent-uuid.c > @@ -30,13 +30,6 @@ > > #include <ndctl/libndctl.h> > > -#ifdef HAVE_NDCTL_H > -#include <linux/ndctl.h> > -#else > -#include <ndctl.h> > -#endif > - > - > static const char *NFIT_TEST_MODULE = "nfit_test"; > static const char *PROVIDER = "nfit_test.0"; > > @@ -149,7 +142,7 @@ static int do_test(struct ndctl_ctx *ctx) > } > > ndctl_region_foreach(bus, region) > - if (ndctl_region_get_nstype(region) == > ND_DEVICE_NAMESPACE_BLK) { > + if (strcmp(ndctl_region_get_type_name(region), > "blk") == 0) { > blk_region = region; > break; > } >
diff --git a/lib/test-parent-uuid.c b/lib/test-parent-uuid.c index a9d7eb1ec2dc..ed0e7f88863b 100644 --- a/lib/test-parent-uuid.c +++ b/lib/test-parent-uuid.c @@ -30,13 +30,6 @@ #include <ndctl/libndctl.h> -#ifdef HAVE_NDCTL_H -#include <linux/ndctl.h> -#else -#include <ndctl.h> -#endif - - static const char *NFIT_TEST_MODULE = "nfit_test"; static const char *PROVIDER = "nfit_test.0"; @@ -149,7 +142,7 @@ static int do_test(struct ndctl_ctx *ctx) } ndctl_region_foreach(bus, region) - if (ndctl_region_get_nstype(region) == ND_DEVICE_NAMESPACE_BLK) { + if (strcmp(ndctl_region_get_type_name(region), "blk") == 0) { blk_region = region; break; }
...to eliminate these warnings when falling back to the local ndctl.h. In file included from lib/test-parent-uuid.c:36:0: ./ndctl.h: In function ‘nvdimm_bus_cmd_name’: ./ndctl.h:127:2: warning: implicit declaration of function ‘ARRAY_SIZE’ [-Wimplicit-function-declaration] if (cmd < ARRAY_SIZE(names) && names[cmd]) ^ ./ndctl.h:127:2: warning: nested extern declaration of ‘ARRAY_SIZE’ [-Wnested-externs] ./ndctl.h:127:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (cmd < ARRAY_SIZE(names) && names[cmd]) ^ ./ndctl.h: In function ‘nvdimm_cmd_name’: ./ndctl.h:146:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (cmd < ARRAY_SIZE(names) && names[cmd]) ^ Cc: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- lib/test-parent-uuid.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)