From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Dan Williams <dan.j.williams@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
linux-nvdimm <linux-nvdimm@lists.01.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] device-dax: delete a redundancy check in dev_dax_validate_align()
Date: Fri, 20 Nov 2020 17:27:25 +0800 [thread overview]
Message-ID: <7ccddd02-e2e6-ec48-43b8-10700285e61c@huawei.com> (raw)
In-Reply-To: <20201120092057.2144-1-thunder.leizhen@huawei.com>
On 2020/11/20 17:20, Zhen Lei wrote:
> After we have done the alignment check for the length of each range, the
> alignment check for dev_dax_size(dev_dax) is no longer needed, because it
> get the sum of the length of each range.
For example:
x/M + y/M = (x + y)/M
If x/M is a integer and y/M is also a integer, then (x + y)/M must be a integer.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
> drivers/dax/bus.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
> index 1efae11d947a..35f9238c0139 100644
> --- a/drivers/dax/bus.c
> +++ b/drivers/dax/bus.c
> @@ -1109,16 +1109,9 @@ static ssize_t align_show(struct device *dev,
>
> static ssize_t dev_dax_validate_align(struct dev_dax *dev_dax)
> {
> - resource_size_t dev_size = dev_dax_size(dev_dax);
> struct device *dev = &dev_dax->dev;
> int i;
>
> - if (dev_size > 0 && !alloc_is_aligned(dev_dax, dev_size)) {
> - dev_dbg(dev, "%s: align %u invalid for size %pa\n",
> - __func__, dev_dax->align, &dev_size);
> - return -EINVAL;
> - }
> -
> for (i = 0; i < dev_dax->nr_range; i++) {
> size_t len = range_len(&dev_dax->ranges[i].range);
>
>
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
next prev parent reply other threads:[~2020-11-20 9:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 9:20 [PATCH 1/1] device-dax: delete a redundancy check in dev_dax_validate_align() Zhen Lei
2020-11-20 9:27 ` Leizhen (ThunderTown) [this message]
2020-12-17 21:49 ` 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=7ccddd02-e2e6-ec48-43b8-10700285e61c@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=vishal.l.verma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox