Skip to content

Commit

Permalink
device-dax: delete a redundancy check in dev_dax_validate_align()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20201120092057.2144-1-thunder.leizhen@huawei.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Zhen Lei authored and djbw committed Dec 17, 2020
1 parent 1aa5743 commit 8bcbe31
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/dax/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,16 +1114,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);

Expand Down

0 comments on commit 8bcbe31

Please sign in to comment.