Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1687388pxb; Mon, 20 Sep 2021 02:55:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWj2H/up14MprljgiVJZPmYQ1TW2SONHbwUFPx8ch2dy/TGyOz/Y2M+tV+YmkfTTKoiZvW X-Received: by 2002:a50:9d47:: with SMTP id j7mr27719741edk.254.1632131718151; Mon, 20 Sep 2021 02:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632131718; cv=none; d=google.com; s=arc-20160816; b=RJL8epiZyNfdj3QmMErKyDPBZJ4au0wBkAUoL0w+E0IkdE4c9IyKMNxdBMRYil+UcP owbSwQduhUudBs7Mb0Pin57+ZHTdZWoIQfYY3KQI3tXdpa3VbnkyDhE/bfCsuY5180i3 /5Htj8T/xmWc1i3SQZ7+NXorHMAhPKWyDjgllUfJA7iaHoSpdcGrzi258Mwp0/15LBMy 1QCeASZixaDj77dWF1fDgPM0dluX3xZ0Kat0LvufRMffI7G3SRrpWv02ekVOUtAeB0Fw YAba50C49E1uA6tX1Px75WVZ2jRFWmlomGMvKKvZ163gGTlPmYL7h+oNtiI7KBtF+wAY EukA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=5eQURRoDRABro2TOkaUezat98SAJTdaIwcERp9k+uwE=; b=YCGxMaS7/xn047BBRxTOZA0urs8bH40ojwhHovFZJEJ/EDgzvHc4mouBQlJSvn07rX LKA7kUKVt0C59oAK7jAGLESbNA55TXY+JEUSoQqycieZtwWMlgoL+W1SJjVi2214cyhe mO3vc6PPQRGMbj1xyAQoqVK1MVLfu0X2ffDEetMBTpcgkgzld9AHq3hJkY2NJ9pqSkMK 0yGwuelomQXJWXz10SXrFgFyEy2OFOFM6iKhK6HwSfWXcemX2YTU/eZDxEmrYKnRy2A6 nBfLNvQwvG3+2bfjaRE7wTfLc3oI9ueTxOYdg+Uk0kgel2y/lSepw4uuQn8ovaAZNsup wpaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=q0ZuLVGS; 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 m28si16840191ejn.203.2021.09.20.02.54.54; Mon, 20 Sep 2021 02:55:18 -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=@canb.auug.org.au header.s=201702 header.b=q0ZuLVGS; 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 S235869AbhITIcL (ORCPT + 99 others); Mon, 20 Sep 2021 04:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235812AbhITIbu (ORCPT ); Mon, 20 Sep 2021 04:31:50 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FD90C061574; Mon, 20 Sep 2021 01:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canb.auug.org.au; s=201702; t=1632126620; bh=5eQURRoDRABro2TOkaUezat98SAJTdaIwcERp9k+uwE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=q0ZuLVGSnIawm9F6X92cEDyIBtNadvpIBisflTkwrh8wXWrlbsxpXJr2uyqYhegIx hwAMrTUo+oM8H1sl4IxS9f7Xx30MnsAXkJAcYc5gKUK22dTJ44sH2edLiKIvAUrlZw TC20fclkI45wCCSoeANo9P6ZFxM2AFBRkG5DyDDwPcM69qkTUbshRuTgI9QEcIoV1w CjLfe6H5XfBPPaXlV8gtzfoFZkYWhNgvzsW2SxAqO2tw8q8yawBr042akm23cQPaqc Bp2yn9Z9BcYQXbevQfs1qt4P18BQpPuad6QRPX+73Wwp1DOKcJI70A9wbjvo8SE5qs /ycxd+yuyxbxQ== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4HCd6K5WCxz9sPT; Mon, 20 Sep 2021 18:30:17 +1000 (AEST) Date: Mon, 20 Sep 2021 18:30:16 +1000 From: Stephen Rothwell To: Yafang Shao Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: build warning after merge of the tip tree Message-ID: <20210920183016.3a4778b5@canb.auug.org.au> In-Reply-To: References: <20210920113330.29f12b99@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/0cMlg/2xDouH=vlIzL4F=zS"; protocol="application/pgp-signature"; micalg=pgp-sha256 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/0cMlg/2xDouH=vlIzL4F=zS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Yafang, On Mon, 20 Sep 2021 14:55:29 +0800 Yafang Shao wrote: > > On Mon, Sep 20, 2021 at 9:33 AM Stephen Rothwell w= rote: > > > > Hi all, > > > > After merging the tip tree, today's linux-next build (powerpc_ppc64 > > defconfig) produced this warning: > > > > kernel/sched/debug.c: In function 'print_cfs_group_stats': > > kernel/sched/debug.c:460:41: warning: unused variable 'stats' [-Wunused= -variable] > > 460 | struct sched_statistics *stats =3D __schedstats= _from_se(se); > > | ^~~~~ > > > > Caused by commit > > > > cb3e971c435d ("sched: Make struct sched_statistics independent of fai= r sched class") > > > > # CONFIG_SCHEDSTATS is not set > > =20 >=20 > Thanks for the report. >=20 > We have discussed this issue before[1]. > This warning happens when CONFIG_SCHEDSTATS is not set and > schedstat_enabled() is 0, so the whole scope should be not compiled. > It seems that we don't need to fix this warning. >=20 > [1]. https://lore.kernel.org/lkml/20210911082505.115758-1-laoar.shao@gmai= l.com/ Clearly it will be compiled if CONFIG_SCHEDSTATS is not set as that is exactly what this build has ... even sections of code guarded by "if (0)" are compiled, they may just not produce any output in the binary. Also, I do not have W=3D1 for this build. If you turned schedstat_val() into a static inline function, then this warning would go away. That also means that argument types and return values will be better checked. So, please fix this. --=20 Cheers, Stephen Rothwell --Sig_/0cMlg/2xDouH=vlIzL4F=zS Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmFIRpkACgkQAVBC80lX 0GydMwf+JEFic2nt1mzqF0mBC64IlIHRKT1Eth0OJ4FT/Uv6VCVPhv4BRcEwwH/O BE8DJkFyhvAQUzQx5EkKcFTeili9w4oHu5og14Oae3Lp3xltGTkldOkbMohiy/UN GB3JwM1+FHu3/fL1BcSfuBejKmGoSfyY5Py4jz+S3lH1zw4eJ6VaVOojC8FeIvV/ HX7md9PzRbDj9Ic5jXScJK/cRh/uwEWxINzXZaTX/z3qRBwxXu8dXlGkh+TLAnqk oKQ56T8qitDk4F0wwDMEFay6qNSQL91KUM5fTO2MC+TISL8mBYK1Q6zybKnAlh/t 8iZHbQkEeKINOSV7Z/jB5NxP0luPHw== =x15c -----END PGP SIGNATURE----- --Sig_/0cMlg/2xDouH=vlIzL4F=zS--