Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1119042pxb; Fri, 20 Nov 2020 01:23:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJuv375J/4GGUGnspUgtoCmgZb2zvrZwYJJ77Uxrs5b/4UxaO/mgRbYKseEuHmN02gpbGf X-Received: by 2002:aa7:cc0e:: with SMTP id q14mr34726839edt.181.1605864197017; Fri, 20 Nov 2020 01:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605864197; cv=none; d=google.com; s=arc-20160816; b=VBt3F7NKlcB3w9QsDi3VTDuI4fu8q6tvRZ/SgrL/MOw0m0qZD/3+SFut4lZL9kPwZ3 TOHJT9hw1iJ/aA3Cnetp+6cbw3c9d9z5V0QODhaSRUlDg8eWgI0k5uJx7PjJyiGETv6z pfRrhT6XTgTbW4G2Tmbpl0fH6RMSohWoHDOD5Ve7ZeFzg771I+k6jP3h3eBWLWkyIdtI IfEJIGGcx7whwiPKIJvcf7KQ6OntZv6r1kqmg2tkFoj9p2A6xb23msTttJ3J7wWUFitf HgHW0vM9YAX7FhF2+Izvo13fKMeBcaJXFkO4UUQ/JR8JWiPygmtRfjDwzBZv6O6NQBzm 4n4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DFw8oBqIOwwuqFIjeismbWe6FuEtZrtFCBo/UmotTi4=; b=mdOGJ48d5XOAomgQFCPgqrAkelU7am/sUP0xHuTBFOerWJHWeSkx6BvuaQ6KJK1QB7 LjJaepJSdg+Gjbp/2SKYkSkOAbXqoqEATAuv1naWKhRp2hA1/RyLniTTvOg1WbcOj5YW VG2JoJ5uT+BC1fN4qYgoaWrbgVZTnWbF9jbKcK6k05cgRLFAe80eENC7oE8h5zKfM4Ka MsRW/H3I4TWV9oPr3aSWXrIv0xy/Wza17RnFfNQA9GCi541dpfHVXD2ZBlJnsbaXk46Z NIX8C7DPiqxjLBugMDL7rjCgvbPGpHHIdPVIibLrxGGtEssqvHjqljbv7M7WrZv43RCE mLcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si1424551edp.41.2020.11.20.01.22.54; Fri, 20 Nov 2020 01:23:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727593AbgKTJVh (ORCPT + 99 others); Fri, 20 Nov 2020 04:21:37 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:8377 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbgKTJVg (ORCPT ); Fri, 20 Nov 2020 04:21:36 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CcrdS5SW4z70n0; Fri, 20 Nov 2020 17:21:16 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.144) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Nov 2020 17:21:25 +0800 From: Zhen Lei To: Dan Williams , Vishal Verma , Dave Jiang , linux-nvdimm , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] device-dax: delete a redundancy check in dev_dax_validate_align() Date: Fri, 20 Nov 2020 17:20:57 +0800 Message-ID: <20201120092057.2144-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.176.144] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.26.0.106.g9fadedd