Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1930766pxb; Mon, 20 Sep 2021 08:23:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3hiup1Q4EMxviNZLmIvVFxYwnvsj7D2OCrxYaFOgG5BjIypgqJO3qwcDC5JMMvNFq6kPZ X-Received: by 2002:a17:906:4758:: with SMTP id j24mr28863221ejs.46.1632151381844; Mon, 20 Sep 2021 08:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632151381; cv=none; d=google.com; s=arc-20160816; b=pv1KJHU72riWmOsP1SMOBcwrqaH9ZnRW8KBdW1qRBzr71+u0zmCmRGWhBS++LaoKFz NJEqZ6h19/5dMWUgGW9Hnx066FvyOp9FZWCm6yWavH+AR9KGXN4vLI26+8Izct43a7sF 5eTnXSH0fDcuK1m4tBBfHZw/kSf3eVvOPzLFlJnlZT7aAvy0xIqmXtKpdQcBYm25HWUR EgCaOjyc9XbhobFz5gWFjrSf2oA6Fays0x2nQc6DZCsncq7akMVfoYpeW3/s7E/mJAIu LX5Xbf20s/YHDZx7MPfA5Yjd9rsm1AtI2717nv6VGd+uDk+imvWqNWcx6LxUhPnU2sRj otrQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wXAGirnc05fwmDCRKFxCiuOQA8x4SwguaJpy5rQKuLU=; b=NzmXg2Pt4P09mECknMYBeidq4WYEVWdgXHSozcNB12aIysgVrxXyTder6OLWWuhbpb jyuS/xRwKpTxKuh5/i4qX5xiTQS9i8lhr6NYHzc4n2Op7cXL6oLDjIoxNUTkpvEJlwSZ 1aDs43BgqXtXr3XlKpc8OeuKXyVVCXDkxtQUUhFpsjZFDbMzvECnWqnmxiq22sDt82mV ppw9Hfi9KkToqYhCnvWn2ecQthJgkt5cIyCN0JLQZsS7FC+chhA/UhAFxdhJW9kFhYGE qYNANL8itdAXLGwOTC3OoPoxOEkNm/9QbI+r9fPb+tfLigBXWfRcASGUxw+ijYfuZeLk //uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=NiV0DVJz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si17836457ejl.218.2021.09.20.08.22.36; Mon, 20 Sep 2021 08:23:01 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=NiV0DVJz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbhITLUp (ORCPT + 99 others); Mon, 20 Sep 2021 07:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbhITLUh (ORCPT ); Mon, 20 Sep 2021 07:20:37 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B666CC061574; Mon, 20 Sep 2021 04:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=wXAGirnc05fwmDCRKFxCiuOQA8x4SwguaJpy5rQKuLU=; b=NiV0DVJz7di1ZXi+Un3kCjWpCq +fWvOftQyuI8z0PvT4qty/Pptb+bM4jNF7bRy7NefYC7E6zb+R5WgtElM38o/vRP5prZ3JXEAbWOd KioeBI8Pi3pehUXZqT8TVhlm1QQmOE/w4YrLlB1Ej1E0SE5qj4iLDOH9HGe203JR8TxF5pdm+3Z0r kt6CuGDJLWgkSNC53iYEjXMdTLdiYMIHiT3fodoRVP3nkPEl3vdXqH+eBywGE0hycCeEgZgQObK7G 1B+z9DLZ+ECEkkc01DSbrYXuhp5MdBU8Cb6p3R1goAoagzG1ArH6RjVRO5JHxvrTFXv7C3tPF3Vku GmcXz5Ww==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSHK3-004VBH-I2; Mon, 20 Sep 2021 11:18:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (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) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3E69B3001EA; Mon, 20 Sep 2021 13:18:54 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E180D212D6916; Mon, 20 Sep 2021 13:18:53 +0200 (CEST) Date: Mon, 20 Sep 2021 13:18:53 +0200 From: Peter Zijlstra To: Stephen Rothwell Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Yafang Shao , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: build warning after merge of the tip tree Message-ID: References: <20210920113330.29f12b99@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20210920113330.29f12b99@canb.auug.org.au> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 20, 2021 at 11:33:30AM +1000, Stephen Rothwell wrote: > Hi all, >=20 > After merging the tip tree, today's linux-next build (powerpc_ppc64 > defconfig) produced this warning: >=20 > kernel/sched/debug.c: In function 'print_cfs_group_stats': > kernel/sched/debug.c:460:41: warning: unused variable 'stats' [-Wunused-v= ariable] > 460 | struct sched_statistics *stats =3D __schedstats_f= rom_se(se); > | ^~~~~ >=20 So I've not seen that one *yet*, I've dont a bunch of SCHEDSTAT=3Dn builds. I do think GCC is being quite stupid for giving it, seeing how the whole thing is within if (0). The GCC people seem to disagree when I brought it up. Anyway, what I did in other parts was the below; that seems to 'upgrade' the warnings from -Wunused-variable to -Wunused-but-set-variable, and that latter *is* in W=3D1, and I'm arguing it should be promoted to W=3D2 or thereabout. Given that whole if(0) {} thing, I don't feel motivated to change things overly much and quite strongly feel this is the compiler being daft. --- diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 935dad7dffb7..ef71de01e4d7 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -457,7 +457,8 @@ static void print_cfs_group_stats(struct seq_file *m, i= nt cpu, struct task_group PN(se->sum_exec_runtime); =20 if (schedstat_enabled()) { - struct sched_statistics *stats =3D __schedstats_from_se(se= ); + struct sched_statistics *stats; + stats =3D __schedstats_from_se(se); =20 PN_SCHEDSTAT(wait_start); PN_SCHEDSTAT(sleep_start);