From: Arnd Bergmann <arnd@kernel.org>
To: Oded Gabbay <ogabbay@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Ofir Bitton <obitton@habana.ai>,
Tomer Tayar <ttayar@habana.ai>,
Omer Shpigelman <oshpigelman@habana.ai>,
Ohad Sharabi <osharabi@habana.ai>,
Alon Mizrahi <amizrahi@habana.ai>,
linux-kernel@vger.kernel.org
Subject: [PATCH] habanalabs: fix enum type mismatch
Date: Wed, 21 Apr 2021 15:52:35 +0200 [thread overview]
Message-ID: <20210421135253.3435360-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
The definition of these two arrays does not match the type of the
enums in them:
drivers/misc/habanalabs/goya/goya.c:136:21: error: implicit conversion from 'enum goya_pll_index' to 'enum pll_index' [-Werror=enum-conversion]
136 | [CPU_PLL] = GOYA_CPU_PLL,
drivers/misc/habanalabs/gaudi/gaudi.c:126:21: error: implicit conversion from 'enum gaudi_pll_index' to 'enum pll_index' [-Werror=enum-conversion]
126 | [CPU_PLL] = GAUDI_CPU_PLL,
Remove the enum and just use literal numbers, which avoids the
warning and is more concise without really losing any information.
Fixes: e8f9392a5c7f ("habanalabs: support legacy and new pll indexes")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/misc/habanalabs/gaudi/gaudi.c | 38 ++++++++-------------------
drivers/misc/habanalabs/goya/goya.c | 29 ++++++--------------
2 files changed, 19 insertions(+), 48 deletions(-)
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index b751652f80a8..69bd7ff694f8 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -105,34 +105,18 @@
#define GAUDI_PLL_MAX 10
-/*
- * this enum kept here for compatibility with old FW (in which each asic has
- * unique PLL numbering
- */
-enum gaudi_pll_index {
- GAUDI_CPU_PLL = 0,
- GAUDI_PCI_PLL,
- GAUDI_SRAM_PLL,
- GAUDI_HBM_PLL,
- GAUDI_NIC_PLL,
- GAUDI_DMA_PLL,
- GAUDI_MESH_PLL,
- GAUDI_MME_PLL,
- GAUDI_TPC_PLL,
- GAUDI_IF_PLL,
-};
-
+/* compatibility with old FW (in which each asic has unique PLL numbering */
static enum pll_index gaudi_pll_map[PLL_MAX] = {
- [CPU_PLL] = GAUDI_CPU_PLL,
- [PCI_PLL] = GAUDI_PCI_PLL,
- [SRAM_PLL] = GAUDI_SRAM_PLL,
- [HBM_PLL] = GAUDI_HBM_PLL,
- [NIC_PLL] = GAUDI_NIC_PLL,
- [DMA_PLL] = GAUDI_DMA_PLL,
- [MESH_PLL] = GAUDI_MESH_PLL,
- [MME_PLL] = GAUDI_MME_PLL,
- [TPC_PLL] = GAUDI_TPC_PLL,
- [IF_PLL] = GAUDI_IF_PLL,
+ [CPU_PLL] = 0,
+ [PCI_PLL] = 1,
+ [SRAM_PLL] = 2,
+ [HBM_PLL] = 3,
+ [NIC_PLL] = 4,
+ [DMA_PLL] = 5,
+ [MESH_PLL] = 6,
+ [MME_PLL] = 7,
+ [TPC_PLL] = 8,
+ [IF_PLL] = 9,
};
static const char gaudi_irq_name[GAUDI_MSI_ENTRIES][GAUDI_MAX_STRING_LEN] = {
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index e27338f4aad2..0a8cf00b5f45 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -118,28 +118,15 @@
#define IS_MME_IDLE(mme_arch_sts) \
(((mme_arch_sts) & MME_ARCH_IDLE_MASK) == MME_ARCH_IDLE_MASK)
-/*
- * this enum kept here for compatibility with old FW (in which each asic has
- * unique PLL numbering
- */
-enum goya_pll_index {
- GOYA_CPU_PLL = 0,
- GOYA_IC_PLL,
- GOYA_MC_PLL,
- GOYA_MME_PLL,
- GOYA_PCI_PLL,
- GOYA_EMMC_PLL,
- GOYA_TPC_PLL,
-};
-
+/* compatibility with old FW (in which each asic has unique PLL numbering */
static enum pll_index goya_pll_map[PLL_MAX] = {
- [CPU_PLL] = GOYA_CPU_PLL,
- [IC_PLL] = GOYA_IC_PLL,
- [MC_PLL] = GOYA_MC_PLL,
- [MME_PLL] = GOYA_MME_PLL,
- [PCI_PLL] = GOYA_PCI_PLL,
- [EMMC_PLL] = GOYA_EMMC_PLL,
- [TPC_PLL] = GOYA_TPC_PLL,
+ [CPU_PLL] = 0,
+ [IC_PLL] = 1,
+ [MC_PLL] = 2,
+ [MME_PLL] = 3,
+ [PCI_PLL] = 4,
+ [EMMC_PLL] = 5,
+ [TPC_PLL] = 6,
};
static const char goya_irq_name[GOYA_MSIX_ENTRIES][GOYA_MAX_STRING_LEN] = {
--
2.29.2
next reply other threads:[~2021-04-21 13:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 13:52 Arnd Bergmann [this message]
2021-04-21 14:08 ` [PATCH] habanalabs: fix enum type mismatch Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210421135253.3435360-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=amizrahi@habana.ai \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=obitton@habana.ai \
--cc=ogabbay@kernel.org \
--cc=osharabi@habana.ai \
--cc=oshpigelman@habana.ai \
--cc=ttayar@habana.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).