Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3200705pxf; Mon, 15 Mar 2021 04:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzIlnvNhky3tMEikAJFe5EUNjPzPtX6S3+8yTWNw/Anb3dCZJ1f596Vj9ozOxJo3rypmxA X-Received: by 2002:a17:906:d9c9:: with SMTP id qk9mr22575298ejb.504.1615806995511; Mon, 15 Mar 2021 04:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615806995; cv=none; d=google.com; s=arc-20160816; b=LhHNaXz62QhHl9jjv5asU5tC6KGNlw0HPErJh8OZde1TBvtEMsu9UJxEijdi9NXNQ1 0m7ef2P6l2hZueQFzQlosWejigTv5s3evotycMAfPbwJStBTkYn9d2aKDhmEuIC7dVPs fNvWAAK8gfHu2VPUv+5I0aM5rd5u6c7pn8gHz7bePEDCxNtxQYea1xbe94gu12LarlLL 8lIT4sV7xVQLbjoaFBDIgjVnMIWnAaD1Xb0pINQScAk8z56JvxVAssWkFs9bNmc70bUu kUJkBiGWfc5bTSr1k0485ym8JxeH1w5KlDE00Vz5oA3FR6YXejt0yNoRIlHaeJsDZSEG HWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=a54isxwYhNrI6zYCte0ub4judHBoIBoF/rgzY6Wwg8c=; b=VqsAx7rBHAdn8hji188tw1cY2b+WDMu7ozARdH/QlC97Z4h4Ab5ZoR6hTDtAmu//x1 /khYdZLaIgs8eXdSWLHLkklgPETOFO5m/22x1RYN5DM4flihslCq2Z19B7LTbZjx8MdL WF8z8wCzE40nP4mWf7K3rOOONVwS+MySvd2bBesa2eZyN2dKj2wEHJ16KQOw5BjfeHjY iKkTGdGJB14707RdRtctWllid3AkkyhIOS4j3MQ4CWCrXnmqFvXt4VgT70dmLXHlRk7P 57Ui3iMNkhn/qxXWNuTTqh7Xj/h3elNILQ2cao/KVKHpLLPidIkWxKQ4UCBIxkWQ/kk3 dsjA== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js21si4012690ejc.447.2021.03.15.04.16.12; Mon, 15 Mar 2021 04:16:35 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229605AbhCOLPG (ORCPT + 99 others); Mon, 15 Mar 2021 07:15:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:46462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbhCOLOh (ORCPT ); Mon, 15 Mar 2021 07:14:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADDC364E61; Mon, 15 Mar 2021 11:14:36 +0000 (UTC) Date: Mon, 15 Mar 2021 11:14:34 +0000 From: Catalin Marinas To: Valdis =?utf-8?Q?Kl=C4=93tnieks?= Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: arm64: kernel/sys.c - silence initialization warnings. Message-ID: <20210315111433.GA22897@arm.com> References: <162859.1615542946@turing-police> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <162859.1615542946@turing-police> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 12, 2021 at 04:55:46AM -0500, Valdis Klētnieks wrote: > Building arch/arm64/kernel/sys.o with W=1 throws over 300 warnings: > > /usr/src/linux-next/arch/arm64/kernel/sys.c:56:40: warning: initialized field overwritten [-Woverride-init] > 56 | #define __SYSCALL(nr, sym) [nr] = __arm64_##sym, > | ^~~~~~~~ > /usr/src/linux-next/include/uapi/asm-generic/unistd.h:29:37: note: in expansion of macro '__SYSCALL' > 29 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys) > | ^~~~~~~~~ > /usr/src/linux-next/include/uapi/asm-generic/unistd.h:34:1: note: in expansion of macro '__SC_COMP' > 34 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup) > | ^~~~~~~~~ > > We know that's pretty much the file's purpose in life, so tell the > build system to not remind us. This makes the 1 other warning a > lot more noticeable. > > Signed-off-by: Valdis Kletnieks > > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > index ed65576ce710..916b21d2b35b 100644 > --- a/arch/arm64/kernel/Makefile > +++ b/arch/arm64/kernel/Makefile > @@ -8,6 +8,7 @@ CFLAGS_armv8_deprecated.o := -I$(src) > CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) > CFLAGS_REMOVE_insn.o = $(CC_FLAGS_FTRACE) > CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE) > +CFLAGS_sys.o += $(call cc-disable-warning, override-init) We do similar initialisation in arch/arm64/kernel/sys32.c and arch/arm64/kernel/traps.c for example. It's a pretty common pattern throughout the kernel. So we either treat W=1 output as diff against the vanilla kernel when checking new patches or we remove override-init altogether from W=1. Mark Rutland pointed me to an older thread: https://lore.kernel.org/linux-arm-kernel/20190809083251.GA48423@lakrids.cambridge.arm.com/ -- Catalin