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


Groups > linux.kernel > #1364272

Re: [PATCH 12/13] libnvdimm, pmem, pfn: move pfn setup to the core

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 12/13] libnvdimm, pmem, pfn: move pfn setup to the core
Date 2016-03-24 16:30 +0100
Message-ID <rgfmW-4w7-15@gated-at.bofh.it> (permalink)
References <rg2g1-3vC-3@gated-at.bofh.it> <rg2g1-3vC-1@gated-at.bofh.it> <rgeAy-3Uf-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 24, 2016 at 7:36 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> On Mittwoch, 23. März 2016 18:26:24 CET Dan Williams wrote:
>> Now that pmem internals have been disentangled from pfn setup, that code
>> can move to the core.  This is in preparation for adding another user of
>> the pfn-device capabilities.
>>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
[..]
>> diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
>> index f8fd379501bf..51a214ee75a7 100644
>> --- a/drivers/nvdimm/pfn_devs.c
>> +++ b/drivers/nvdimm/pfn_devs.c
[..]
>> +static int nd_pfn_init(struct nd_pfn *nd_pfn)
>> +{
>> +     struct nd_namespace_common *ndns = nd_pfn->ndns;
>> +     u32 start_pad = 0, end_trunc = 0;
>> +     resource_size_t start, size;
>> +     struct nd_namespace_io *nsio;
>> +     struct nd_region *nd_region;
>> +     struct nd_pfn_sb *pfn_sb;
>> +     unsigned long npfns;
>> +     phys_addr_t offset;
>> +     u64 checksum;
>> +     int rc;
>> +
>> +     pfn_sb = devm_kzalloc(&nd_pfn->dev, sizeof(*pfn_sb), GFP_KERNEL);
>> +     if (!pfn_sb)
>> +             return -ENOMEM;
>> +
>> +     nd_pfn->pfn_sb = pfn_sb;
>> +     rc = nd_pfn_validate(nd_pfn);
>> +     if (rc == -ENODEV)
>> +             /* no info block, do init */;
>> +     else
>> +             return rc;
>
> Why not:
> if (rc != -ENODEV)
>         return  rc;
> /* no info block, do init */

Looks good to me, will fix.

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


Thread

[PATCH 12/13] libnvdimm, pmem, pfn: move pfn setup to the core Dan Williams <dan.j.williams@intel.com> - 2016-03-24 02:30 +0100
  Re: [PATCH 12/13] libnvdimm, pmem, pfn: move pfn setup to the core Johannes Thumshirn <jthumshirn@suse.de> - 2016-03-24 15:40 +0100
    Re: [PATCH 12/13] libnvdimm, pmem, pfn: move pfn setup to the core Dan Williams <dan.j.williams@intel.com> - 2016-03-24 16:30 +0100
  [PATCH v2] libnvdimm, pmem, pfn: move pfn setup to the core Dan Williams <dan.j.williams@intel.com> - 2016-03-25 23:20 +0100
    Re: [PATCH v2] libnvdimm, pmem, pfn: move pfn setup to the core Johannes Thumshirn <jthumshirn@suse.de> - 2016-03-29 10:40 +0200

csiph-web