From: Dan Williams <dan.j.williams@intel.com> To: linux-nvdimm@lists.01.org Cc: willy@linux.intel.com, ross.zwisler@linux.intel.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] libnvdimm, pfn: clean up pfn create parameters Date: Mon, 14 Dec 2015 18:14:39 -0800 [thread overview] Message-ID: <20151215021439.37090.42307.stgit@dwillia2-desk3.jf.intel.com> (raw) In-Reply-To: <20151215021428.37090.30720.stgit@dwillia2-desk3.jf.intel.com> In all cases __nd_pfn_create is called with default parameters which are then overridden by values in the info block. Clean up pfn creation by dropping the parameters and setting default values internal to __nd_pfn_create. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/nvdimm/pfn_devs.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 96c122918ee1..613ffcca6ecb 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -179,7 +179,6 @@ static const struct attribute_group *nd_pfn_attribute_groups[] = { }; static struct device *__nd_pfn_create(struct nd_region *nd_region, - u8 *uuid, enum nd_pfn_mode mode, struct nd_namespace_common *ndns) { struct nd_pfn *nd_pfn; @@ -199,10 +198,7 @@ static struct device *__nd_pfn_create(struct nd_region *nd_region, return NULL; } - nd_pfn->mode = mode; - if (uuid) - uuid = kmemdup(uuid, 16, GFP_KERNEL); - nd_pfn->uuid = uuid; + nd_pfn->mode = PFN_MODE_NONE; dev = &nd_pfn->dev; dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); dev->parent = &nd_region->dev; @@ -220,8 +216,7 @@ static struct device *__nd_pfn_create(struct nd_region *nd_region, struct device *nd_pfn_create(struct nd_region *nd_region) { - struct device *dev = __nd_pfn_create(nd_region, NULL, PFN_MODE_NONE, - NULL); + struct device *dev = __nd_pfn_create(nd_region, NULL); if (dev) __nd_device_register(dev); @@ -304,7 +299,7 @@ int nd_pfn_probe(struct nd_namespace_common *ndns, void *drvdata) return -ENODEV; nvdimm_bus_lock(&ndns->dev); - dev = __nd_pfn_create(nd_region, NULL, PFN_MODE_NONE, ndns); + dev = __nd_pfn_create(nd_region, ndns); nvdimm_bus_unlock(&ndns->dev); if (!dev) return -ENOMEM;
WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com> To: linux-nvdimm@ml01.01.org Cc: willy@linux.intel.com, ross.zwisler@linux.intel.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] libnvdimm, pfn: clean up pfn create parameters Date: Mon, 14 Dec 2015 18:14:39 -0800 [thread overview] Message-ID: <20151215021439.37090.42307.stgit@dwillia2-desk3.jf.intel.com> (raw) In-Reply-To: <20151215021428.37090.30720.stgit@dwillia2-desk3.jf.intel.com> In all cases __nd_pfn_create is called with default parameters which are then overridden by values in the info block. Clean up pfn creation by dropping the parameters and setting default values internal to __nd_pfn_create. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/nvdimm/pfn_devs.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 96c122918ee1..613ffcca6ecb 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -179,7 +179,6 @@ static const struct attribute_group *nd_pfn_attribute_groups[] = { }; static struct device *__nd_pfn_create(struct nd_region *nd_region, - u8 *uuid, enum nd_pfn_mode mode, struct nd_namespace_common *ndns) { struct nd_pfn *nd_pfn; @@ -199,10 +198,7 @@ static struct device *__nd_pfn_create(struct nd_region *nd_region, return NULL; } - nd_pfn->mode = mode; - if (uuid) - uuid = kmemdup(uuid, 16, GFP_KERNEL); - nd_pfn->uuid = uuid; + nd_pfn->mode = PFN_MODE_NONE; dev = &nd_pfn->dev; dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); dev->parent = &nd_region->dev; @@ -220,8 +216,7 @@ static struct device *__nd_pfn_create(struct nd_region *nd_region, struct device *nd_pfn_create(struct nd_region *nd_region) { - struct device *dev = __nd_pfn_create(nd_region, NULL, PFN_MODE_NONE, - NULL); + struct device *dev = __nd_pfn_create(nd_region, NULL); if (dev) __nd_device_register(dev); @@ -304,7 +299,7 @@ int nd_pfn_probe(struct nd_namespace_common *ndns, void *drvdata) return -ENODEV; nvdimm_bus_lock(&ndns->dev); - dev = __nd_pfn_create(nd_region, NULL, PFN_MODE_NONE, ndns); + dev = __nd_pfn_create(nd_region, ndns); nvdimm_bus_unlock(&ndns->dev); if (!dev) return -ENOMEM;
next prev parent reply other threads:[~2015-12-15 2:14 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-12-15 2:14 [PATCH 0/9] libnvdimm, pfn updates for 4.5 Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` [PATCH 1/9] libnvdimm, pfn: kill ND_PFN_ALIGN Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` Dan Williams [this message] 2015-12-15 2:14 ` [PATCH 2/9] libnvdimm, pfn: clean up pfn create parameters Dan Williams 2015-12-15 2:14 ` [PATCH 3/9] libnvdimm, pfn: add 'align' attribute, default to HPAGE_SIZE Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` [PATCH 4/9] libnvdimm, pfn: add parent uuid validation Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:14 ` [PATCH 5/9] libnvdimm, pfn: fix pfn seed creation Dan Williams 2015-12-15 2:14 ` Dan Williams 2015-12-15 2:15 ` [PATCH 6/9] libnvdimm, pfn: enable pfn sysfs interface unit testing Dan Williams 2015-12-15 2:15 ` Dan Williams 2015-12-15 2:15 ` [PATCH 7/9] libnvdimm, pfn: fix nd_pfn_validate() return value handling Dan Williams 2015-12-15 2:15 ` Dan Williams 2015-12-15 2:15 ` [PATCH 8/9] tools/testing/libnvdimm: cleanup mock resource lookup Dan Williams 2015-12-15 2:15 ` Dan Williams 2015-12-15 7:11 ` Dan Williams 2015-12-15 7:11 ` Dan Williams 2015-12-15 2:15 ` [PATCH 9/9] libnvdimm, pfn: move 'memory mode' indication to sysfs Dan Williams 2015-12-15 2:15 ` Dan Williams
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=20151215021439.37090.42307.stgit@dwillia2-desk3.jf.intel.com \ --to=dan.j.williams@intel.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=ross.zwisler@linux.intel.com \ --cc=willy@linux.intel.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.