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


Groups > linux.kernel > #1712689

Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region alignments in sysfs

From Oliver <oohall@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region alignments in sysfs
Date 2017-08-16 07:30 +0200
Message-ID <ueZ3X-2XF-1@gated-at.bofh.it> (permalink)
References <udx06-4QR-11@gated-at.bofh.it> <ueDd7-64p-7@gated-at.bofh.it> <ueDPQ-6jk-17@gated-at.bofh.it> <ueMgq-37n-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 16, 2017 at 1:47 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Mon, Aug 14, 2017 at 11:46 PM, Oliver <oohall@gmail.com> wrote:
>> On Tue, Aug 15, 2017 at 4:02 PM, kbuild test robot <lkp@intel.com> wrote:
> [..]
>>>    114  static const unsigned long *nd_pfn_supported_alignments(void)
>>>    115  {
>>>    116          /*
>>>    117           * This needs to be a local variable because the *_SIZE macros
>>>    118           * aren't always constants.
>>>    119           */
>>
>> I probably should have been clearer, "local" here really means
>> "non-static". Otherwise the array could have been made a global.
>>
>
> Whoops, my fault. How about this:
>
> @@ -127,8 +127,11 @@ static const unsigned long
> *nd_pfn_supported_alignments(void)
>  #endif
>                 0,
>         };
> +       static unsigned long data[ARRAY_SIZE(supported_alignments)];
>
> -       return supported_alignments;
> +       memcpy(data, supported_alignments, sizeof(data));
> +
> +       return data;
>  }

That should do the trick, but you'll need to fix up the source array
declaration too.

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


Thread

[PATCH 0/3] libnvdimm: export supported page size alignments Dan Williams <dan.j.williams@intel.com> - 2017-08-12 07:20 +0200
  [PATCH 3/3] libnvdimm, pfn,  dax: limit namespace alignments to the supported set Dan Williams <dan.j.williams@intel.com> - 2017-08-12 07:20 +0200
  [PATCH 2/3] libnvdimm, pfn,  dax: show supported dax/pfn region alignments in sysfs Dan Williams <dan.j.williams@intel.com> - 2017-08-12 07:20 +0200
    Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region  alignments in sysfs Oliver <oohall@gmail.com> - 2017-08-15 08:50 +0200
      Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region  alignments in sysfs Dan Williams <dan.j.williams@intel.com> - 2017-08-15 17:50 +0200
        Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region  alignments in sysfs Oliver <oohall@gmail.com> - 2017-08-16 07:30 +0200

csiph-web