From patchwork Mon Jan 10 06:55:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 12708272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7348FC433EF for ; Mon, 10 Jan 2022 06:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WJJSJXQWo9A0YpcrvGP3Yw2RT0Cecrv52Spvx4r9u3c=; b=Qz+HNOuUy/gkvN LM/m2u7dBJlrvvalRkSOD7GMePmKegp+AKBf6ujWTQoPGgjv/N08HKa41ITmEO/MAZZVQloholUfb tr1zhhPwYaKw41sXoXL5eg8ImpAUr1i71GmPEc3COFEoMeusWEaw9k3Q6EBRsx50qRtb4KnyLwLJM Ee12Z64iuUUBl603XSIDwLuCTRZzcUcSgvrPVg3icxczshCbOHPiE/2jAu1XI4NyLb5AdmTvXYIyk r5zhl3Xmw9Bejm/ba42O007YfiHIiDR28j0xkUTjnoDY4Fd1IJ8mmpRXjm8I7x6vNOjBJtG0bazKG 6EGPPlM/EO4kL+jV/jQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6oan-009Y3H-Sp; Mon, 10 Jan 2022 06:55:45 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6oal-009Y2S-1t for linux-riscv@lists.infradead.org; Mon, 10 Jan 2022 06:55:44 +0000 Received: by mail-pj1-x102b.google.com with SMTP id l10-20020a17090a384a00b001b22190e075so21251646pjf.3 for ; Sun, 09 Jan 2022 22:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ga/Od3KnKWj8t6bt46K7KiC7VAoXXyAJ/YENFxvbQ9w=; b=ZGvbg7Pcc3RY8usQUiwJ70tWCipo+jDomplquSHS7TFkDP7pGXK9fEAwJzsC2EjlU4 POFvCJNXLUj2dkbch5qJhwp/lnlfIAYHCLKwTRy4AlyLR06YPy8wlMHBNpJofB4aT2n7 3GJeX0Sde+v+OxwS+iUdGd/VtqjOWV7NtnIuC5Rs8g3rF7+R32Ndh3pyEbMoKI9gYNkA 0jTMl8X7jeS7cJbpimDOe6GQP7xuzuWKuJaLIDXtCgJOabuutKMvt1y/M/pSbI5KlpKe gn94uU8a/S+oxruC1NVSrhe1uXLgysy6hDiJwVWH9XtGD26Oxq+h83Br/i1pWZQ7T2py KU/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ga/Od3KnKWj8t6bt46K7KiC7VAoXXyAJ/YENFxvbQ9w=; b=SOulJziNUu9iGFlIF546mVaxPT+bsyXdgBYYmws9x0Z6emSkj33dVKlJc2bk2kkCKf AVimtmsBD/eqhV+KU7SPPaI4CWOmZ3ctX26UyuGzt6XEF7SJAmbHZ/uBlS+fqManzlWN qyy6fzsEc3mgMkSneP/DbssJzI9r+VZ3g/aVRJpPkmyZyoxwF3+UBPXGNXYTMyNOqbsi c4MwZmb+LZUCxtWiKYgvoxTWSwgnOE01/TnyOXSVrlPeS/VjvE5mGF31NFYfugGlZI1p s1q1yBqHpQ67Iwkv53oRYiYmiRA+Og664l+VFN79RbiOwbk9j5gVYxuueao9fnVRf4aP TFDQ== X-Gm-Message-State: AOAM532FpIYB8jCUvjG/CgnZZKdIJ2QcqMHQErOWwvRtlmDR08t5yjl8 zhRWzg/pmtt4FQ9ef7fdsy6QcrLtdelQ/xMo X-Google-Smtp-Source: ABdhPJygnowcodFXZOaiKLsuhj1pifUF4euGfkHh2D6F5h/eVvxnLUIj1WXdfjnIqQnnoNzXQAzqtQ== X-Received: by 2002:a17:903:22ca:b0:14a:15ab:ba27 with SMTP id y10-20020a17090322ca00b0014a15abba27mr10061732plg.128.1641797742079; Sun, 09 Jan 2022 22:55:42 -0800 (PST) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id j8sm5955231pfc.11.2022.01.09.22.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 22:55:41 -0800 (PST) From: Zong Li To: mturquette@baylibre.com, sboyd@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, lee.jones@linaro.org, linux-clk@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Zong Li Subject: [PATCH v4] clk: sifive: Fix W=1 kernel build warning Date: Mon, 10 Jan 2022 14:55:36 +0800 Message-Id: <20220110065536.11451-1-zong.li@sifive.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220109_225543_136205_33AB5BCC X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This commit reverts commit 487dc7bb6a0c ("clk: sifive: fu540-prci: Declare static const variable 'prci_clk_fu540' where it's used"). For fixing W=1 kernel build warning(s) about ‘prci_clk_fu540’ defined but not used [-Wunused-const-variable=], the problem is that the C file of fu540 and fu740 doesn't use these variables, but they include the header files. We could refine the code by moving the definition of these variables into fu540 and fu740 implementation respectively instead of common core code, then we could still separate the SoCs-dependent data in their own implementation. Fixes: 487dc7bb6a0c ("clk: sifive: fu540-prci: Declare static const variable 'prci_clk_fu540' where it's used") Signed-off-by: Zong Li --- Changed in v4: - Rebase on v5.16 - Modify fixes tag Changed in v3: - Rebase on v5.16-rc8 - Add fixes tag Changed in v2: - Move definition of variable to C file from header --- drivers/clk/sifive/fu540-prci.c | 6 +++++- drivers/clk/sifive/fu540-prci.h | 6 +----- drivers/clk/sifive/fu740-prci.c | 6 +++++- drivers/clk/sifive/fu740-prci.h | 11 +---------- drivers/clk/sifive/sifive-prci.c | 5 ----- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c index 29bab915003c..5568bc26e36f 100644 --- a/drivers/clk/sifive/fu540-prci.c +++ b/drivers/clk/sifive/fu540-prci.c @@ -20,7 +20,6 @@ #include -#include "fu540-prci.h" #include "sifive-prci.h" /* PRCI integration data for each WRPLL instance */ @@ -87,3 +86,8 @@ struct __prci_clock __prci_init_clocks_fu540[] = { .ops = &sifive_fu540_prci_tlclksel_clk_ops, }, }; + +struct prci_clk_desc prci_clk_fu540 = { + .clks = __prci_init_clocks_fu540, + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540), +}; diff --git a/drivers/clk/sifive/fu540-prci.h b/drivers/clk/sifive/fu540-prci.h index c220677dc010..931d6cad8c1c 100644 --- a/drivers/clk/sifive/fu540-prci.h +++ b/drivers/clk/sifive/fu540-prci.h @@ -7,10 +7,6 @@ #ifndef __SIFIVE_CLK_FU540_PRCI_H #define __SIFIVE_CLK_FU540_PRCI_H -#include "sifive-prci.h" - -#define NUM_CLOCK_FU540 4 - -extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540]; +extern struct prci_clk_desc prci_clk_fu540; #endif /* __SIFIVE_CLK_FU540_PRCI_H */ diff --git a/drivers/clk/sifive/fu740-prci.c b/drivers/clk/sifive/fu740-prci.c index 53f6e00a03b9..0ade3dcd24ed 100644 --- a/drivers/clk/sifive/fu740-prci.c +++ b/drivers/clk/sifive/fu740-prci.c @@ -8,7 +8,6 @@ #include -#include "fu540-prci.h" #include "sifive-prci.h" /* PRCI integration data for each WRPLL instance */ @@ -132,3 +131,8 @@ struct __prci_clock __prci_init_clocks_fu740[] = { .ops = &sifive_fu740_prci_pcie_aux_clk_ops, }, }; + +struct prci_clk_desc prci_clk_fu740 = { + .clks = __prci_init_clocks_fu740, + .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740), +}; diff --git a/drivers/clk/sifive/fu740-prci.h b/drivers/clk/sifive/fu740-prci.h index 511a0bf7ba2b..5bc0e18f058c 100644 --- a/drivers/clk/sifive/fu740-prci.h +++ b/drivers/clk/sifive/fu740-prci.h @@ -7,15 +7,6 @@ #ifndef __SIFIVE_CLK_FU740_PRCI_H #define __SIFIVE_CLK_FU740_PRCI_H -#include "sifive-prci.h" - -#define NUM_CLOCK_FU740 9 - -extern struct __prci_clock __prci_init_clocks_fu740[NUM_CLOCK_FU740]; - -static const struct prci_clk_desc prci_clk_fu740 = { - .clks = __prci_init_clocks_fu740, - .num_clks = ARRAY_SIZE(__prci_init_clocks_fu740), -}; +extern struct prci_clk_desc prci_clk_fu740; #endif /* __SIFIVE_CLK_FU740_PRCI_H */ diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index 80a288c59e56..916d2fc28b9c 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -12,11 +12,6 @@ #include "fu540-prci.h" #include "fu740-prci.h" -static const struct prci_clk_desc prci_clk_fu540 = { - .clks = __prci_init_clocks_fu540, - .num_clks = ARRAY_SIZE(__prci_init_clocks_fu540), -}; - /* * Private functions */