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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFE05C433F5 for ; Fri, 24 Sep 2021 08:13:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9191610CF for ; Fri, 24 Sep 2021 08:13:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A9191610CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M6EK2+wcz985KEFtLIRpJUl0HdaPWf1pn7yar/CAWec=; b=I+TyvVzT5Km72VOCDKdw/atcak sd+AQmj1HGPe058PqHOohkRL6GDJ11H37vPBflq4uMKDyeTWRjLIFjB0manc6woBpXyV7J2Y8nO+I WnfGb7dVxQmsCzTo+UmYyrVU+fLRix5OjmPNyf28oZ/SpqX8E+IydTcIYEV96cwILLD9d3UJM96Zn ZLY9IZe4lND7um/QcU4mYZrrFsrdCZ4a1YkhBfZAcBCVuMAd14jXnmQOi8qqK2PJz1R264J2Z7nAn nNo+W3R5IaeBhHmOIoJK4NU3Kn3OC/0IR1VpDMA2Vkc2NXMbUlP25LQKPUFziQVicHbxcVnPzuaml 862G+PDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTgJb-00DSnC-36; Fri, 24 Sep 2021 08:12:15 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTgJX-00DSmD-0z; Fri, 24 Sep 2021 08:12:12 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 5C564580B96; Fri, 24 Sep 2021 04:12:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 24 Sep 2021 04:12:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=yndppNLi5xOLzLSSkN38dgk5j9X 7eiv2GLzQ4HvYja4=; b=hyLFQPR1WoHJ1+U117PZrEtAoFDsv0lWwlK/lD+QbKY OH2JPiHkGnoXgukQZuxV5rZ8AyZkIvBYP+0g9iJFQuUah+tnBu6RqbGo72o5W8cn c/bxw/pMhv6pxmpJ2OIIf6peUHPJpB2UuPB7ImT86X7PmxsczefNrbE4c/6A3cJm i6ZU199MPSN3hR1QmHBiGn2tpWVh8UakXNP7lFNjUn6MuqD+ZujTWQn7doiIQvCQ 0grUoAR8V+dDlS4yJB6OQctB3b+hwVWJdH94mFCVkPKLtMYohY/TDjvpqSFhkV7H GYTTGloQMoaaxzSOZZfO+CSSepvMIZ0LrErQ3VyKA6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=yndppN Li5xOLzLSSkN38dgk5j9X7eiv2GLzQ4HvYja4=; b=v/5NOwGWXWK5OhTOJyDU97 kgmJoMbjh+cuJ/zXH698s0e0/f1cxpLSF2ZixzDiq0pCqPiT+pVSklJoXgGkiWwj JRyGpqjP4balt2X636SE7iYRfmjZH+hul7utim2wpZ1Df+oJNf6QrNUdARoZQ7Ez TEO7qs04QXVSAS2BIK8Htl1NDfEavdl3+Qk7QWdst4uUjwEVVZZ4/LT79NwTX/hf 4hzXehvwvyGiQQSEycFgcZCCXwhvcKjducnSuGiQyw0ZFRlQlI5BuYkwijJv0+yV gvMnLKiP+YA+bRu+x3zx69YTdH3d95zSbiq0sC9ccj/icYlK7vjmPSx1V+QgN98g == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejuddgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Sep 2021 04:12:08 -0400 (EDT) Date: Fri, 24 Sep 2021 10:12:07 +0200 From: Maxime Ripard To: Linus Torvalds Cc: Maarten Lankhorst , Thomas Zimmermann , Daniel Vetter , David Airlie , linux-rpi-kernel@lists.infradead.org, Florian Fainelli , Nicolas Saenz Julienne , Linux ARM , Nathan Chancellor , Randy Dunlap , Stephen Rothwell Subject: Re: [PATCH] drm/vc4: hdmi: Fix defined but not used warning Message-ID: <20210924081207.uey6f2fc7yj6ypmj@gilmour> References: <20210923155728.703312-1-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210924_011211_168360_F3BC1FB3 X-CRM114-Status: GOOD ( 26.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7484732454081715009==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7484732454081715009== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pko2zsqkhq3jykoh" Content-Disposition: inline --pko2zsqkhq3jykoh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 23, 2021 at 09:54:06AM -0700, Linus Torvalds wrote: > On Thu, Sep 23, 2021 at 8:57 AM Maxime Ripard wrote: > > > > Since we select CONFIG_PM anyway, vc4_hdmi_runtime_suspend() and > > vc4_hdmi_runtime_suspend() will always be used and we can thus always > > assign them in struct dev_pm_ops without using the SET_RUNTIME_PM_OPS > > macro. >=20 > This cannot be true. >=20 > If CONFIG_PM is always enabled, then the patch is a no-op, and the > warning you quote cannot happen: >=20 > warning: 'vc4_hdmi_runtime_suspend' defined but not used [-Wunused-fun= ction] >=20 > So this patch is very obviously broken, the message is misleading, and > the claims in your commit message cannot _possibly_ be true. I guess it could have been worded a bit better. DRM_VC4 allows compilation through COMPILE_TEST and selects PM. Some platforms don't define PM at all. In the latter case, SET_RUNTIME_PM_OPS will be a nop, the functions won't be used, and we'll get this warning. > Maxime, this kind of "respond to bug reports with random contents" > most not continue. I'm not super familiar with how to deal with those kind of situations, but it does address the warning on those platforms without affecting the current operations of the driver. I don't see how it qualifies as random. > You need to actually look at what the reporter is reporting, and think > about the code. Because the above fix is broken, broken, broken. Like I said, this was a genuine attempt at fixing things. It's clear now that you don't feel the same way and would prefer some other solution. That's why we have review in the first place I guess? I fail to see what that kind of personal comments brings to the discussion though. > The way people fix this is by either making the function definitions > be conditional on their uses - so that the compiler removes them > entirely - or mark them as __maybe_unused. Then a smart _linker_ can > actually remove the code if people use the smarter linker options. The initial point of selecting CONFIG_PM was to get rid of the #ifdef, and for all practical purposes the code will always be used when the driver will run so __maybe_unused didn't look like a proper solution either. Maxime --pko2zsqkhq3jykoh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYU2IVwAKCRDj7w1vZxhR xQMeAQDZ9Y3PZx+hNw2BjyRobWaSQyCoM/rxp9KoMrKeLgfnJQD+PYDitKNURUXo zOMcJhv7WFlakTnIpy/sXxRDf5jgywg= =tX4N -----END PGP SIGNATURE----- --pko2zsqkhq3jykoh-- --===============7484732454081715009== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7484732454081715009==--