Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1914833rwo; Thu, 3 Aug 2023 01:34:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGfGRv1ThO/Gwt5qLKtCHExYmRWRf6LupL3xjGQwyslmW0rnuGPq5yDG44e6QtJ0+5M5lQR X-Received: by 2002:a17:902:e88f:b0:1b5:26d4:517d with SMTP id w15-20020a170902e88f00b001b526d4517dmr18641816plg.29.1691051685329; Thu, 03 Aug 2023 01:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691051685; cv=none; d=google.com; s=arc-20160816; b=Nm9gRWyuPtsiezJci8Y+1W1jBMzo52BnoDhg2pHFQizXLwfNF0jfutbV4w0QqqCIcw Pmwwer4z5NYxl5Ycm3WUzCoZLOxJaOM6lCwi2x2uxQrf6OUxUbkj/qsezzhbckIz0C8f Rq4goWwONEUkAgcDEzQDWcsMy6oQS0plC+0+31+a39EGex9U7Ot+yTBuY2G3wcgKXzAQ 7T1yaL9QvGxTbF4htb6pkwDjC/SJg8j2HBwemzYTehCfwoRFxku3YU0NV0imn02z3KHo DHwj1abfNYwQXr/CAOFWfA1uo3yzzGTFNTAMmi1dsRHJ6ns8yoTDVXN6xikv34PMwN3Z DSQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature; bh=T8FL0GA4rQZAINUMDNU93QtXhCGJsUzkRPMqEUYci1Y=; fh=+KGM05x3bpPcyZow/ohhbZL0gUVMSzGjcHkMh5wW4po=; b=IZ7VYQHpk/XV1uv0nePXT+Ocvx9/ZLW81dqT0GA9r13PAn8m28zE5IOXw5YetwVvC3 FT//Sd4CB6I2rrt8V5Mptb9bor4Jyv9q6DpREsL0OLPaXJWRhqdpEcGcjGej3mjC/LnT uE0tOP4aXDeyM2q845zHOuBwnQE/Vxwfw95Sq3DsCcfw0XpOcpHHXwnZhMgzii9f1bku r4HP2mx1ApBSpcPZNyHD/2FB96aRG5wzAwAyYQKp59tL6tW74fC6oTi1mqqHgZlbnHgC fKbSro1YT+HpYp41qBFA8FMxJYC2s3zzmz9kF4dbknCGJ1HwxLQyW7jyNpTD9Do0svOW oacw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C6Z+Tjea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li6-20020a170903294600b001b8922e82e3si12092638plb.297.2023.08.03.01.34.32; Thu, 03 Aug 2023 01:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C6Z+Tjea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbjHCIIT (ORCPT + 99 others); Thu, 3 Aug 2023 04:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbjHCIHk (ORCPT ); Thu, 3 Aug 2023 04:07:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 081175FE8; Thu, 3 Aug 2023 00:58:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9A1D761C77; Thu, 3 Aug 2023 07:58:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79D28C433C7; Thu, 3 Aug 2023 07:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691049537; bh=1qShQjYaIAI9saShacA94XNnUPtQtDSYRE2iho6abzY=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=C6Z+TjeaxxbACJdwD8YPcW4jlhHMmgoVwaIYyg4uJUvfPF5CYLoW01pzEFrcFN1Tm KF+k/vxoEt79Vr8Q+h0Sf+/9R/S1PuYtIAHdhpnL32AR+0FVdOp5qpq8pKL1BpY1Sg 7WmpDrYFRfu5BjvU2kb/A2IJKDF6q6vxhRqgKqWN9IQfAltnErNsWpT1AEVLpp55kP NGnSSApl7fQckh1dJ/nxuVPIrRRmpsHPX3YBP7QeDlDlvZB8IUXmLm+3aMzt1I2z3E MXVhM9+4dpoKbQFFqaMf+QVrm4TWVIF9Lfc0c0YvipHdkX9i+EjENgFMwMoImInn6w 4qLhA6bjM/IbA== Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 4557D27C0054; Thu, 3 Aug 2023 03:58:55 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 03 Aug 2023 03:58:55 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkedugdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugeskhgvrhhnvghlrdhorhhgqeenucggtf frrghtthgvrhhnpedvlefhudeuveekueejuefhveefudefueetuddvieejffehffeiieet leejlefftdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhguodhmvghsmhhtphgruhht hhhpvghrshhonhgrlhhithihqdduvdekhedujedtvdegqddvkeejtddtvdeigedqrghrnh gupeepkhgvrhhnvghlrdhorhhgsegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i36794607:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 97527B60089; Thu, 3 Aug 2023 03:58:54 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230802092647.3000666-1-sergio.paracuellos@gmail.com> <9a22ecee-ebb0-437e-bd2b-99b5c6944855@app.fastmail.com> Date: Thu, 03 Aug 2023 09:58:34 +0200 From: "Arnd Bergmann" To: "Sergio Paracuellos" Cc: "Michael Turquette" , "Nathan Chancellor" , "Nick Desaulniers" , "Stephen Boyd" , "Thomas Bogendoerfer" , clang-built-linux , "kernel test robot" , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: ralink: mtmips: quiet unused variable warning Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 3, 2023, at 00:35, Sergio Paracuellos wrote: > Hi Arnd.=20 > > El El jue, 3 ago 2023 a las 0:02, Arnd Bergmann escr= ibi=C3=B3: >> On Wed, Aug 2, 2023, at 23:26, Nick Desaulniers wrote: >> > On Wed, Aug 2, 2023 at 2:26=E2=80=AFAM Sergio Paracuellos wrote: >> >> >> >> When CONFIG_OF is disabled then the matching table is not referenc= ed and >> >> the following warning appears: >> >> >> >> drivers/clk/ralink/clk-mtmips.c:821:34: warning: unused variable '= mtmips_of_match' [-Wunused-const-variable] >> >> 821 | static const struct of_device_id mtmips_of_match[] =3D { >> >> | ^ >> >> >> >> Silence it declaring 'mtmips_of_match' with '__maybe_unused'. >> >> >> >> Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for = MTMIPS SoCs") >> >> Reported-by: kernel test robot >> >> Closes: https://lore.kernel.org/oe-kbuild-all/202307242310.CdOnd2p= y-lkp@intel.com/ >> >> Signed-off-by: Sergio Paracuellos >> > >> > I think this is fine; Arnd or Nathan do you have a preference? or t= houghts here? >> > >> > If not, thanks for the patch. >> > Reviewed-by: Nick Desaulniers >> > >> > (I have a slight preference for wrapping the use in `#ifdef CONFIG_= OF` >> > since with the approach used by this patch, if all users are removed >> > we will never get a warning for this var. But it's a weak preferenc= e; >> > it's more important to me that we don't have -Werror promote this >> > warning to a build breakage) >>=20 >> I don't understand why there are two match tables in the same >> driver, with almost the same contents. I have not looked very >> closely here, but why can't we just drop the mtmips_clk_of_match[] >> table (the one without the .data fields) and use the same >> table for both? Is this because of the ralink,rt2880-reset entry >> that is missing in mtmips_of_match, or is that another bug? > > ralink,rt2880-reset is for old dts compatibility and only applies to=20 > reset driver. The one with data fields apply for clocks and is needed. Ok, I see. It still looks like the two tables can simply be merged by adding the ralink,rt2880-reset entry to mtmips_of_match[], which will allow it to be used for mtmips_clk_driver (which doesn't use the data) as well as for mtmips_clk_init() (which doesn't need get called for ralink,rt2880-reset). >> I also see that there is both a platform_driver instance for >> late probing and a list of CLK_OF_DECLARE_DRIVER() entries. >> Do we need both here? > > This system controller driver provide clock and reset controllers.=20 > Clock cannot be a platform driver since we need to set=20 > mips_hpr_frequency at a very early sargento. Reset stuff can be a=20 > platform driver so both of them are needed. Arnd