Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2813694pxb; Mon, 1 Nov 2021 02:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz4iEXltQ3g+XBXpKrem2rWLw07HLrhP7vWMsFp6Ys9E50GTBhffTNHPu36ApfKEgLhcPa X-Received: by 2002:a17:907:6eaa:: with SMTP id sh42mr26695913ejc.556.1635758365433; Mon, 01 Nov 2021 02:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635758365; cv=none; d=google.com; s=arc-20160816; b=uguRj67tU+5ta30k8o3O2huxOQxkn9SyzK+PQCXQVl9n0ktLWvf3tnLZaEnDcYZvXb cKHBc1/WJjIpJPJvhWx8CvJKcbYjuiBD65BnVZPFJiMcZJ52hOWsXj/WUzjr68ZgYysS An6EFKUQHm7TwXHUAl524C96ruecTxkaOEzb3pCLvLvg1bOXXYI4ozadf0e67y2UzAwC a+VLBidAkVXT8ARN4VZ3dZhR1BWxX4cOpOsJ9lLl0UmQ4jvuU5jpTp4Ih5tooVWjcHUQ Szns1CRXGGnE6hODwTwuEOnSZIxUKMVYEDG3O7KtcUGNcWQ+bs0+O/CbSjPObcrqq/7M K2ig== 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=8mHOKtbwkLpkq9KVLyP5kCf/L6UuHVPuX6JVcPyZARY=; b=Eenzv6XfXbmZgevsuRkazGjD5dXsvwyfH8A34iLcV2KFe6yW5mfA+orh4p2FyDcTI9 5Um/XPTxMrU4v2WPbxjFQsj22ucVUI1zz4M6zGB9Bh9LirVIamdW7zcA+sFATZFAm2rr YTX0D7DuJ/jWtP1BIwEFsWMhsNY8J2JJqrC/4CfpDihqSfWczGktxphYLc47FZlxyXJg 7esr5m8Mv8g2gA767L1wCxtUQZKDkx6bBgH34GUUm+YhKSy45CzOQt+UIfsFqaOLnpS3 whBF8vai33oPGlUR2HHH7blYsiZ6fLjwFHGR2MIIcuBKmQIHUzOJOo7t5dj2a9oaQccO Kbhw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz22si7275318ejb.676.2021.11.01.02.19.01; Mon, 01 Nov 2021 02:19:25 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbhKAJTu (ORCPT + 99 others); Mon, 1 Nov 2021 05:19:50 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:13994 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbhKAJTs (ORCPT ); Mon, 1 Nov 2021 05:19:48 -0400 Received: from dggeme762-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HjS6j0DpXzZcKP; Mon, 1 Nov 2021 17:15:09 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.44) by dggeme762-chm.china.huawei.com (10.3.19.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Mon, 1 Nov 2021 17:17:11 +0800 From: Gaosheng Cui To: , CC: , , Subject: [PATCH -next] efi/libstub: arm32: Use "align" for the size alignment Date: Mon, 1 Nov 2021 17:18:54 +0800 Message-ID: <20211101091854.190982-1-cuigaosheng1@huawei.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.44] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme762-chm.china.huawei.com (10.3.19.108) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are doing page-based allocations, and both the address and size must meet alignment constraints, so using "align" for the size alignment is a better choice. Signed-off-by: Gaosheng Cui --- drivers/firmware/efi/libstub/relocate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/relocate.c b/drivers/firmware/efi/libstub/relocate.c index 8ee9eb2b9039..d6d27e8c23f8 100644 --- a/drivers/firmware/efi/libstub/relocate.c +++ b/drivers/firmware/efi/libstub/relocate.c @@ -50,7 +50,7 @@ efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align, if (align < EFI_ALLOC_ALIGN) align = EFI_ALLOC_ALIGN; - size = round_up(size, EFI_ALLOC_ALIGN); + size = round_up(size, align); nr_pages = size / EFI_PAGE_SIZE; for (i = 0; i < map_size / desc_size; i++) { efi_memory_desc_t *desc; -- 2.30.0