Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5059351rdb; Tue, 12 Dec 2023 18:49:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSFF2TU/d01Hp8yBnSzGLCRFFC9Uho7ly21OgBuK8sOEkBC4Q0nqyTkh1FZFSQJjKijc6A X-Received: by 2002:a25:9e8a:0:b0:db4:af02:6626 with SMTP id p10-20020a259e8a000000b00db4af026626mr4632284ybq.29.1702435776649; Tue, 12 Dec 2023 18:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702435776; cv=none; d=google.com; s=arc-20160816; b=JJGuwbG3EOjQQ7J5u6p4xnNw2qCEQWa3BWuKGjkFj3yOxYsEym1s86m44rgYP4I9MP EIjOEXB/b3l6Qre9KS+QKKQVJXj3wLbtIApJ3OZXAswWluXRlMNFR0iIpRwucTyWnaZB BMuGlSxosGBh8UCTsEkulzbR2CCMUC/M9wi2jqWIT0rq57jLADoOFkQHvRtE9pa4n1N6 V+/laK+afAad8M6pfjVoILvQFevGu8kuVlHQ8JLERZDCBpxVkIbZhg6QBDHk/F7HEHww ZCQ6cflqOBwOPOc3zomUKLbPftI8NQxj3hr77xogEdUU3sb4soe8pv86QvDZlCu0WK4i QL5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=coQ8pvaq2UkX5cEo9LeuOuQYxw7SGcKK+T3HPyA15No=; fh=PNIn7osOYJveij21qIagpYuFOkZDSGmTPgam/UwM4io=; b=FFHfLabC7HxtmiQdPUOxqMzFyRWho1pyvLE1Yoz8f1p0/UKuBAi7kU9nW78gmNUSRP TkU+KSTvN21rEbyIp7ugRWpBO6S4xg66D3B8qrWx5w13F0vwShyi2pEYHcH3OAy2jOuI pEO3Z/2rujq3RTnVgsjmIRoVlhQc0VXBCKcnsfjG1cTkARRsB+GQEzkUcLfEIWH/TMG7 a/VIgMT8nIHjztOvqA0otu6iOHn7+hNjTLyJSy7aFOIy0bEwO8VruNuCBNJOo8ru97WA 29EW/wi+/duqYX7kxtVrW1BGIMhX0fUpKuQHCfC1dd9+dWvw34/zwgm7V+tv5shgdj6p ePnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F7FbRF12; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id jc19-20020a17090325d300b001d0c9868aadsi8650766plb.227.2023.12.12.18.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 18:49:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F7FbRF12; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0304580A9E03; Tue, 12 Dec 2023 18:49:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378329AbjLMCtL (ORCPT + 99 others); Tue, 12 Dec 2023 21:49:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378288AbjLMCtL (ORCPT ); Tue, 12 Dec 2023 21:49:11 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9817798 for ; Tue, 12 Dec 2023 18:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702435756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=coQ8pvaq2UkX5cEo9LeuOuQYxw7SGcKK+T3HPyA15No=; b=F7FbRF122HkJkrGhzIXOS88MTpupKmvGiHrFF7EPgAom/wDkQppJ3Z5DTnvUDzXPz471GJ /yksR+GocbGjiH6oYenLrygU1066+waP4SqOwAblH+3eAw1IvZBKoeYlMZHh/jJoTMtoHJ R3skccOI+cxmmlbKvXKi8UnKz/ZaIG0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-n-aNT_MWPnmDeaWCx57W_A-1; Tue, 12 Dec 2023 21:49:13 -0500 X-MC-Unique: n-aNT_MWPnmDeaWCx57W_A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ACC7A830F96; Wed, 13 Dec 2023 02:49:12 +0000 (UTC) Received: from localhost (unknown [10.72.116.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFA9D2026D66; Wed, 13 Dec 2023 02:49:11 +0000 (UTC) Date: Wed, 13 Dec 2023 10:49:08 +0800 From: Baoquan He To: Yuntao Wang Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, Eric Biederman , Andrew Morton Subject: Re: [PATCH] kexec: Use ALIGN macro instead of open-coding it Message-ID: References: <20231212142706.25149-1-ytcoode@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212142706.25149-1-ytcoode@gmail.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 18:49:34 -0800 (PST) On 12/12/23 at 10:27pm, Yuntao Wang wrote: > Use ALIGN macro instead of open-coding it to improve code readability. > > Signed-off-by: Yuntao Wang > --- > kernel/kexec_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) LGTM, Acked-by: Baoquan He > > diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c > index be5642a4ec49..0113436e4a3a 100644 > --- a/kernel/kexec_core.c > +++ b/kernel/kexec_core.c > @@ -430,7 +430,7 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image, > > pages = NULL; > size = (1 << order) << PAGE_SHIFT; > - hole_start = (image->control_page + (size - 1)) & ~(size - 1); > + hole_start = ALIGN(image->control_page, size); > hole_end = hole_start + size - 1; > while (hole_end <= crashk_res.end) { > unsigned long i; > @@ -447,7 +447,7 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image, > mend = mstart + image->segment[i].memsz - 1; > if ((hole_end >= mstart) && (hole_start <= mend)) { > /* Advance the hole to the end of the segment */ > - hole_start = (mend + (size - 1)) & ~(size - 1); > + hole_start = ALIGN(mend, size); > hole_end = hole_start + size - 1; > break; > } > -- > 2.43.0 > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec >