From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA580C433EF for ; Thu, 31 Mar 2022 16:05:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8583E6B0073; Thu, 31 Mar 2022 12:05:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 806FF6B0074; Thu, 31 Mar 2022 12:05:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CF306B0075; Thu, 31 Mar 2022 12:05:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 5FB846B0073 for ; Thu, 31 Mar 2022 12:05:59 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 22D9C1831B69B for ; Thu, 31 Mar 2022 16:05:59 +0000 (UTC) X-FDA: 79305157638.21.D113AD7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 52CBC14003B for ; Thu, 31 Mar 2022 16:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648742757; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qlNDdytnQWIJBK5ptvz+5RJyq/CJNTkwbMf9B+B4Xl8=; b=RiVAkdacD//ougVozWcNyK9YWZ7S7K4mTXWIizv2JLCDWugI7Gae77vNcDi09XBPx0H9iJ CF1IemK3uyvWLZUWNF/mamCDERYv5P4QVCQsBA2A0UW7GSJYjZ78rmZxKf46MSdde10gF0 Q3ykgCOT7kd4gfNhQJF8SkqIdUmCZDg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-246-KUwr1XLXM8-rloxnZjefuA-1; Thu, 31 Mar 2022 12:05:56 -0400 X-MC-Unique: KUwr1XLXM8-rloxnZjefuA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D0552803D7C; Thu, 31 Mar 2022 16:05:53 +0000 (UTC) Received: from [10.18.17.215] (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id B23A2C080B3; Thu, 31 Mar 2022 16:05:50 +0000 (UTC) Message-ID: <03351a36-a1c6-8125-4945-57727334dc26@redhat.com> Date: Thu, 31 Mar 2022 12:05:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3] mm/sparsemem: Fix 'mem_section' will never be NULL gcc 12 warning Content-Language: en-US To: kernel test robot , Andrew Morton Cc: kbuild-all@lists.01.org, Linux Memory Management List , linux-kernel@vger.kernel.org, "Kirill A . Shutemov" , Ingo Molnar , Justin Forbes , Rafael Aquini References: <20220330205919.2713275-1-longman@redhat.com> <202203312327.XGeCiD5T-lkp@intel.com> From: Waiman Long In-Reply-To: <202203312327.XGeCiD5T-lkp@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Stat-Signature: juh746eriisnugfmmtwwd9f1ic6789so Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RiVAkdac; spf=none (imf26.hostedemail.com: domain of longman@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 52CBC14003B X-HE-Tag: 1648742758-744809 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 3/31/22 11:54, kernel test robot wrote: > Hi Waiman, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on hnaz-mm/master] > > url: https://github.com/intel-lab-lkp/linux/commits/Waiman-Long/mm-sparsemem-Fix-mem_section-will-never-be-NULL-gcc-12-warning/20220331-050049 > base: https://github.com/hnaz/linux-mm master > config: arm-randconfig-c024-20220330 (https://download.01.org/0day-ci/archive/20220331/202203312327.XGeCiD5T-lkp@intel.com/config) > compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/2098f1d78cde338e81b3ba596ea39f37824e496e > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Waiman-Long/mm-sparsemem-Fix-mem_section-will-never-be-NULL-gcc-12-warning/20220331-050049 > git checkout 2098f1d78cde338e81b3ba596ea39f37824e496e > # save the config file to linux build tree > mkdir build_dir > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash security/keys/encrypted-keys/ > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > In file included from include/linux/gfp.h:6, > from include/linux/umh.h:4, > from include/linux/kmod.h:9, > from include/linux/module.h:17, > from security/keys/encrypted-keys/encrypted.c:15: > security/keys/encrypted-keys/encrypted.c: In function 'derived_key_encrypt.constprop': >>> include/linux/mmzone.h:1432:23: warning: array subscript 32 is outside array bounds of 'struct mem_section[32][1]' [-Warray-bounds] > 1432 | unsigned long map = section->section_mem_map; > | ^~~ > include/linux/mmzone.h:1390:27: note: while referencing 'mem_section' > 1390 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; > | ^~~~~~~~~~~ > > > vim +1432 include/linux/mmzone.h > > 29751f6991e845 Andy Whitcroft 2005-06-23 1429 > 29751f6991e845 Andy Whitcroft 2005-06-23 1430 static inline struct page *__section_mem_map_addr(struct mem_section *section) > 29751f6991e845 Andy Whitcroft 2005-06-23 1431 { > 29751f6991e845 Andy Whitcroft 2005-06-23 @1432 unsigned long map = section->section_mem_map; > 29751f6991e845 Andy Whitcroft 2005-06-23 1433 map &= SECTION_MAP_MASK; > 29751f6991e845 Andy Whitcroft 2005-06-23 1434 return (struct page *)map; > 29751f6991e845 Andy Whitcroft 2005-06-23 1435 } > 29751f6991e845 Andy Whitcroft 2005-06-23 1436 I think this is a pre-existing warning. It is not caused by my patch, but I will take a look what cause the warning. Thanks, Longman