Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4393229ioa; Wed, 27 Apr 2022 02:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyeWSf0sUSDMKei5q7RN7sTPNDa46SAFSEAsmqlEmaTfd5lc8WsuNAhaDlJ0joKv8qs65d X-Received: by 2002:a05:6a00:a02:b0:4fd:f9dd:5494 with SMTP id p2-20020a056a000a0200b004fdf9dd5494mr29326938pfh.68.1651053173237; Wed, 27 Apr 2022 02:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651053173; cv=none; d=google.com; s=arc-20160816; b=fG+flRRgpF5dKmiSNj7VZlOk4X55CvK+zVuf8Bbv0FpBrc4EhCUl3KYN4vIOWWA7+8 TwEfDkZ3DsV+xzMRil2frzUszUj0HAV8u3nD4gzVkIQyn4So8Iy+paslrgyp7DGDHosa Q28D6UqF3e1naV5P8Jt1NGDvXBn+u4Q3ykjkK2c+zyQMHOhc4sI6R02ExGYJheY83+9Y 0Nl1XCmB9L67NzYa/LsDPy4EBiPBzAnCGwDw+yn41qQuAm6y+8gFKp/papRoLfnwgDbp niIKOtTg13AtXa+Zg8K0fJuIa4P89pfj5cOTA6nuSUWnr7qkDasD7NQmUsyTYB7MlHKt RBvg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5jiEBJVaO8MZJXv+CiTWZaIrJSLfP8RH1cBFJ8bti0U=; b=eQNj9PcbZzcrr/VGEKXOORfUzonyUomXPlptveyteey6UkOoI6RCxgsBNqByBVlBis A1GSE0KFyyN+aeymLZmnwDeLowOmu6xMlicpPcCniRb1a8O0jyyzGL3ObOcSU4bsS6U5 jRRYoxyeGFzndExGJc7OgilIRnYxqor4wYlCucU2F5zPzHBWl3NUHe4jCVdKNHK5M/Fu HFy/sBtTNpRsUGuPMDwlqmtgz15C3Jsi4tcHKpR2avgQTrLmA/sGVHEa3doav5OBANEO mGz7LRfIHwea5hdJUyv6qXkQa1OxZa707kDIoiXrMRKA2heILZPOeIGB14ZOnt21R2nE SDgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EtLcjtPu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 14-20020a056a00072e00b0050d4f5ccb83si820670pfm.311.2022.04.27.02.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:52:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EtLcjtPu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B0D1529A8F1; Wed, 27 Apr 2022 02:22:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243327AbiDZJNI (ORCPT + 99 others); Tue, 26 Apr 2022 05:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346118AbiDZIty (ORCPT ); Tue, 26 Apr 2022 04:49:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC3DDBCB63; Tue, 26 Apr 2022 01:37:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 47860603E0; Tue, 26 Apr 2022 08:37:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4392DC385A0; Tue, 26 Apr 2022 08:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962272; bh=BqlJmf3wDeHhcQdYFA4oOF63G1/VMqOxsY6c4XxTyTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtLcjtPuzblH20E7QODlLhNw15di/evstiFN+gHZ2YGG5tFw6Mj5zYGK6F9SDwq81 kDADEt8PM/xM3XUN6+KYU0W+sXVTvduxjC/rr8j89aEzcyAqR5TPA2VvzIDzpjhDlI S1n9snBcVveq6VG6vrreIPoYkVUjkto3dy8H3vzg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiongwei Song , Arthur Marsh , Andrew Morton , Linus Torvalds , Khem Raj Subject: [PATCH 5.15 009/124] mm: page_alloc: fix building error on -Werror=array-compare Date: Tue, 26 Apr 2022 10:20:10 +0200 Message-Id: <20220426081747.562576608@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiongwei Song commit ca831f29f8f25c97182e726429b38c0802200c8f upstream. Arthur Marsh reported we would hit the error below when building kernel with gcc-12: CC mm/page_alloc.o mm/page_alloc.c: In function `mem_init_print_info': mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare] 8173 | if (start <= pos && pos < end && size > adj) \ | In C++20, the comparision between arrays should be warned. Link: https://lkml.kernel.org/r/20211125130928.32465-1-sxwjean@me.com Signed-off-by: Xiongwei Song Reported-by: Arthur Marsh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Khem Raj Signed-off-by: Greg Kroah-Hartman --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8169,7 +8169,7 @@ void __init mem_init_print_info(void) */ #define adj_init_size(start, end, size, pos, adj) \ do { \ - if (start <= pos && pos < end && size > adj) \ + if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \ size -= adj; \ } while (0)