From: Dan Williams <dan.j.williams@intel.com> To: Oliver <oohall@gmail.com> Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>, kbuild test robot <lkp@intel.com>, kbuild-all@01.org Subject: Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region alignments in sysfs Date: Tue, 15 Aug 2017 08:47:02 -0700 [thread overview] Message-ID: <CAPcyv4g-bk2ppR2HM85=rmCHB1TaZ4FL2oLMNgKsv56HWDE6Gg@mail.gmail.com> (raw) In-Reply-To: <CAOSf1CGa3BBmDZ5KjsK0fsT8e7uN10oTSqKNyognAe+8hSDKVQ@mail.gmail.com> 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; } _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com> To: Oliver <oohall@gmail.com> Cc: kbuild test robot <lkp@intel.com>, kbuild-all@01.org, "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region alignments in sysfs Date: Tue, 15 Aug 2017 08:47:02 -0700 [thread overview] Message-ID: <CAPcyv4g-bk2ppR2HM85=rmCHB1TaZ4FL2oLMNgKsv56HWDE6Gg@mail.gmail.com> (raw) In-Reply-To: <CAOSf1CGa3BBmDZ5KjsK0fsT8e7uN10oTSqKNyognAe+8hSDKVQ@mail.gmail.com> 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; }
next prev parent reply other threads:[~2017-08-15 15:44 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-08-12 5:12 [PATCH 0/3] libnvdimm: export supported page size alignments Dan Williams 2017-08-12 5:12 ` Dan Williams 2017-08-12 5:12 ` [PATCH 1/3] libnvdimm: rename nd_sector_size_{show, store} to nd_size_select_{show, store} Dan Williams 2017-08-12 5:12 ` Dan Williams 2017-08-12 5:12 ` [PATCH 2/3] libnvdimm, pfn, dax: show supported dax/pfn region alignments in sysfs Dan Williams 2017-08-12 5:12 ` Dan Williams 2017-08-15 6:02 ` kbuild test robot 2017-08-15 6:02 ` kbuild test robot 2017-08-15 6:46 ` Oliver 2017-08-15 6:46 ` Oliver 2017-08-15 15:47 ` Dan Williams [this message] 2017-08-15 15:47 ` Dan Williams 2017-08-16 5:23 ` Oliver 2017-08-16 5:23 ` Oliver 2017-08-12 5:12 ` [PATCH 3/3] libnvdimm, pfn, dax: limit namespace alignments to the supported set Dan Williams 2017-08-12 5:12 ` 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='CAPcyv4g-bk2ppR2HM85=rmCHB1TaZ4FL2oLMNgKsv56HWDE6Gg@mail.gmail.com' \ --to=dan.j.williams@intel.com \ --cc=kbuild-all@01.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=lkp@intel.com \ --cc=oohall@gmail.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.