All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver <oohall@gmail.com>
To: Dan Williams <dan.j.williams@intel.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: Wed, 16 Aug 2017 15:23:08 +1000	[thread overview]
Message-ID: <CAOSf1CEBYYNTPffkzCbBZvTPXBw=GQjd4hMC4HGeN=48S_Vqcw@mail.gmail.com> (raw)
In-Reply-To: <CAPcyv4g-bk2ppR2HM85=rmCHB1TaZ4FL2oLMNgKsv56HWDE6Gg@mail.gmail.com>

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.
_______________________________________________
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: Oliver <oohall@gmail.com>
To: Dan Williams <dan.j.williams@intel.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: Wed, 16 Aug 2017 15:23:08 +1000	[thread overview]
Message-ID: <CAOSf1CEBYYNTPffkzCbBZvTPXBw=GQjd4hMC4HGeN=48S_Vqcw@mail.gmail.com> (raw)
In-Reply-To: <CAPcyv4g-bk2ppR2HM85=rmCHB1TaZ4FL2oLMNgKsv56HWDE6Gg@mail.gmail.com>

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.

  reply	other threads:[~2017-08-16  5:20 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
2017-08-15 15:47         ` Dan Williams
2017-08-16  5:23         ` Oliver [this message]
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='CAOSf1CEBYYNTPffkzCbBZvTPXBw=GQjd4hMC4HGeN=48S_Vqcw@mail.gmail.com' \
    --to=oohall@gmail.com \
    --cc=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 \
    /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: link
Be 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.