From: Eric Wu <kunjinkao.jp@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-mips@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, Eric Wu <kunjinkao.jp@gmail.com>
Subject: [PATCH 2/7] staging: octeon: convert cvmx_helper_interface_mode_t from typedef to plain enum
Date: Mon, 27 Apr 2026 23:54:22 +0800 [thread overview]
Message-ID: <20260427155427.668540-3-kunjinkao.jp@gmail.com> (raw)
In-Reply-To: <20260427155427.668540-1-kunjinkao.jp@gmail.com>
The Linux kernel coding style discourages the use of typedefs for
enums. Convert cvmx_helper_interface_mode_t to a plain 'enum
cvmx_helper_interface_mode' and update all users across the MIPS
Octeon architecture code and the staging driver stubs.
No functional change.
Signed-off-by: Eric Wu <kunjinkao.jp@gmail.com>
---
arch/mips/cavium-octeon/executive/cvmx-helper-util.c | 2 +-
arch/mips/cavium-octeon/executive/cvmx-helper.c | 8 ++++----
arch/mips/cavium-octeon/executive/cvmx-pko.c | 2 +-
arch/mips/include/asm/octeon/cvmx-helper-util.h | 2 +-
arch/mips/include/asm/octeon/cvmx-helper.h | 6 +++---
drivers/staging/octeon/ethernet.c | 2 +-
drivers/staging/octeon/octeon-stubs.h | 6 +++---
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-util.c b/arch/mips/cavium-octeon/executive/cvmx-helper-util.c
index 53b912745dbd..abaf91f6ae7c 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-util.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-util.c
@@ -52,7 +52,7 @@
*
* Returns String
*/
-const char *cvmx_helper_interface_mode_to_string(cvmx_helper_interface_mode_t
+const char *cvmx_helper_interface_mode_to_string(enum cvmx_helper_interface_mode
mode)
{
switch (mode) {
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
index 9abfc4bf9bd8..1985cd66806a 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
@@ -95,7 +95,7 @@ EXPORT_SYMBOL_GPL(cvmx_helper_ports_on_interface);
* @INTERNAL
* Return interface mode for CN68xx.
*/
-static cvmx_helper_interface_mode_t __cvmx_get_mode_cn68xx(int interface)
+static enum cvmx_helper_interface_mode __cvmx_get_mode_cn68xx(int interface)
{
union cvmx_mio_qlmx_cfg qlm_cfg;
switch (interface) {
@@ -147,7 +147,7 @@ static cvmx_helper_interface_mode_t __cvmx_get_mode_cn68xx(int interface)
* @INTERNAL
* Return interface mode for an Octeon II
*/
-static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface)
+static enum cvmx_helper_interface_mode __cvmx_get_mode_octeon2(int interface)
{
union cvmx_gmxx_inf_mode mode;
@@ -247,7 +247,7 @@ static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface)
* @INTERNAL
* Return interface mode for CN7XXX.
*/
-static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface)
+static enum cvmx_helper_interface_mode __cvmx_get_mode_cn7xxx(int interface)
{
union cvmx_gmxx_inf_mode mode;
@@ -289,7 +289,7 @@ static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface)
* Returns Mode of the interface. Unknown or unsupported interfaces return
* DISABLED.
*/
-cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface)
+enum cvmx_helper_interface_mode cvmx_helper_interface_get_mode(int interface)
{
union cvmx_gmxx_inf_mode mode;
diff --git a/arch/mips/cavium-octeon/executive/cvmx-pko.c b/arch/mips/cavium-octeon/executive/cvmx-pko.c
index 6e70b859a0ac..760abbe12479 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-pko.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-pko.c
@@ -120,7 +120,7 @@ static void __cvmx_pko_port_map_o68(void)
{
int port;
int interface, index;
- cvmx_helper_interface_mode_t mode;
+ enum cvmx_helper_interface_mode mode;
union cvmx_pko_mem_iport_ptrs config;
/*
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-util.h b/arch/mips/include/asm/octeon/cvmx-helper-util.h
index 97b27a07cfb0..103bb5b3142b 100644
--- a/arch/mips/include/asm/octeon/cvmx-helper-util.h
+++ b/arch/mips/include/asm/octeon/cvmx-helper-util.h
@@ -42,7 +42,7 @@
* Returns String
*/
extern const char
- *cvmx_helper_interface_mode_to_string(cvmx_helper_interface_mode_t mode);
+ *cvmx_helper_interface_mode_to_string(enum cvmx_helper_interface_mode mode);
/**
* Setup Random Early Drop to automatically begin dropping packets.
diff --git a/arch/mips/include/asm/octeon/cvmx-helper.h b/arch/mips/include/asm/octeon/cvmx-helper.h
index 0cddce35291b..98824ff6314c 100644
--- a/arch/mips/include/asm/octeon/cvmx-helper.h
+++ b/arch/mips/include/asm/octeon/cvmx-helper.h
@@ -38,7 +38,7 @@
#include <asm/octeon/cvmx-fpa.h>
#include <asm/octeon/cvmx-wqe.h>
-typedef enum {
+enum cvmx_helper_interface_mode {
CVMX_HELPER_INTERFACE_MODE_DISABLED,
CVMX_HELPER_INTERFACE_MODE_RGMII,
CVMX_HELPER_INTERFACE_MODE_GMII,
@@ -49,7 +49,7 @@ typedef enum {
CVMX_HELPER_INTERFACE_MODE_PICMG,
CVMX_HELPER_INTERFACE_MODE_NPI,
CVMX_HELPER_INTERFACE_MODE_LOOP,
-} cvmx_helper_interface_mode_t;
+};
union cvmx_helper_link_info {
uint64_t u64;
@@ -125,7 +125,7 @@ extern int cvmx_helper_get_number_of_interfaces(void);
* Returns Mode of the interface. Unknown or unsupported interfaces return
* DISABLED.
*/
-extern cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
+extern enum cvmx_helper_interface_mode cvmx_helper_interface_get_mode(int
interface);
/**
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index eadb74fc14c8..5f9c29071fab 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -798,7 +798,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
num_interfaces = cvmx_helper_get_number_of_interfaces();
for (interface = 0; interface < num_interfaces; interface++) {
- cvmx_helper_interface_mode_t imode =
+ enum cvmx_helper_interface_mode imode =
cvmx_helper_interface_get_mode(interface);
int num_ports = cvmx_helper_ports_on_interface(interface);
int port;
diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index 289a2d41fdc5..6c0329270464 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -222,7 +222,7 @@ enum cvmx_spi_mode {
CVMX_SPI_MODE_DUPLEX = 3
};
-typedef enum {
+enum cvmx_helper_interface_mode {
CVMX_HELPER_INTERFACE_MODE_DISABLED,
CVMX_HELPER_INTERFACE_MODE_RGMII,
CVMX_HELPER_INTERFACE_MODE_GMII,
@@ -233,7 +233,7 @@ typedef enum {
CVMX_HELPER_INTERFACE_MODE_PICMG,
CVMX_HELPER_INTERFACE_MODE_NPI,
CVMX_HELPER_INTERFACE_MODE_LOOP,
-} cvmx_helper_interface_mode_t;
+};
typedef enum {
CVMX_POW_WAIT = 1,
@@ -1267,7 +1267,7 @@ static inline void cvmx_pko_get_port_status(u64 port_num, u64 clear,
cvmx_pko_port_status_t *status)
{ }
-static inline cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
+static inline enum cvmx_helper_interface_mode cvmx_helper_interface_get_mode(int
interface)
{
return 0;
--
2.43.0
next prev parent reply other threads:[~2026-04-27 15:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 15:54 [PATCH 0/7] staging: octeon: remove typedefs for enums and structs Eric Wu
2026-04-27 15:54 ` [PATCH 1/7] staging: octeon: convert cvmx_spi_mode_t from typedef to plain enum Eric Wu
2026-04-27 15:54 ` Eric Wu [this message]
2026-04-27 15:54 ` [PATCH 3/7] staging: octeon: convert cvmx_pow_wait_t " Eric Wu
2026-04-27 15:54 ` [PATCH 4/7] staging: octeon: convert cvmx_pko_lock_t " Eric Wu
2026-04-27 15:54 ` [PATCH 5/7] staging: octeon: convert cvmx_pko_status_t " Eric Wu
2026-04-27 15:54 ` [PATCH 6/7] staging: octeon: convert cvmx_pko_port_status_t from typedef to plain struct Eric Wu
2026-04-27 15:54 ` [PATCH 7/7] staging: octeon: convert cvmx_pip_port_status_t " Eric Wu
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=20260427155427.668540-3-kunjinkao.jp@gmail.com \
--to=kunjinkao.jp@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=tsbogend@alpha.franken.de \
/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