[PATCH 5/7] staging: octeon: convert cvmx_pko_status_t from typedef to plain enum
From: Eric Wu
Date: Mon Apr 27 2026 - 12:16:21 EST
The Linux kernel coding style discourages the use of typedefs for
enums. Convert cvmx_pko_status_t to a plain 'enum cvmx_pko_status' 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@xxxxxxxxx>
---
arch/mips/cavium-octeon/executive/cvmx-pko.c | 4 ++--
arch/mips/include/asm/octeon/cvmx-pko.h | 10 +++++-----
drivers/staging/octeon/octeon-stubs.h | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/mips/cavium-octeon/executive/cvmx-pko.c b/arch/mips/cavium-octeon/executive/cvmx-pko.c
index 760abbe12479..b0199d5cb551 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-pko.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-pko.c
@@ -323,11 +323,11 @@ EXPORT_SYMBOL_GPL(cvmx_pko_shutdown);
* queues have higher priority than higher numbered queues.
* There must be num_queues elements in the array.
*/
-cvmx_pko_status_t cvmx_pko_config_port(uint64_t port, uint64_t base_queue,
+enum cvmx_pko_status cvmx_pko_config_port(uint64_t port, uint64_t base_queue,
uint64_t num_queues,
const uint64_t priority[])
{
- cvmx_pko_status_t result_code;
+ enum cvmx_pko_status result_code;
uint64_t queue;
union cvmx_pko_mem_queue_ptrs config;
union cvmx_pko_reg_queue_ptrs1 config1;
diff --git a/arch/mips/include/asm/octeon/cvmx-pko.h b/arch/mips/include/asm/octeon/cvmx-pko.h
index d8e74a305646..a742c1d61d8f 100644
--- a/arch/mips/include/asm/octeon/cvmx-pko.h
+++ b/arch/mips/include/asm/octeon/cvmx-pko.h
@@ -80,7 +80,7 @@
#define CVMX_PKO_ILLEGAL_QUEUE 0xFFFF
#define CVMX_PKO_MAX_QUEUE_DEPTH 0
-typedef enum {
+enum cvmx_pko_status {
CVMX_PKO_SUCCESS,
CVMX_PKO_INVALID_PORT,
CVMX_PKO_INVALID_QUEUE,
@@ -88,7 +88,7 @@ typedef enum {
CVMX_PKO_NO_MEMORY,
CVMX_PKO_PORT_ALREADY_SETUP,
CVMX_PKO_CMD_QUEUE_INIT_ERROR
-} cvmx_pko_status_t;
+};
/**
* This enumeration represents the different locking modes supported by PKO.
@@ -306,7 +306,7 @@ extern void cvmx_pko_shutdown(void);
* of a value of 1. There must be num_queues elements in the
* array.
*/
-extern cvmx_pko_status_t cvmx_pko_config_port(uint64_t port,
+extern enum cvmx_pko_status cvmx_pko_config_port(uint64_t port,
uint64_t base_queue,
uint64_t num_queues,
const uint64_t priority[]);
@@ -414,7 +414,7 @@ static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue,
* Returns: CVMX_PKO_SUCCESS on success, or error code on
* failure of output
*/
-static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(
+static inline enum cvmx_pko_status cvmx_pko_send_packet_finish(
uint64_t port,
uint64_t queue,
union cvmx_pko_command_word0 pko_command,
@@ -457,7 +457,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(
* Returns: CVMX_PKO_SUCCESS on success, or error code on
* failure of output
*/
-static inline cvmx_pko_status_t cvmx_pko_send_packet_finish3(
+static inline enum cvmx_pko_status cvmx_pko_send_packet_finish3(
uint64_t port,
uint64_t queue,
union cvmx_pko_command_word0 pko_command,
diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index 06cb4f15d9d5..8496c60d647e 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -246,7 +246,7 @@ enum cvmx_pko_lock {
CVMX_PKO_LOCK_CMD_QUEUE = 2,
};
-typedef enum {
+enum cvmx_pko_status {
CVMX_PKO_SUCCESS,
CVMX_PKO_INVALID_PORT,
CVMX_PKO_INVALID_QUEUE,
@@ -254,7 +254,7 @@ typedef enum {
CVMX_PKO_NO_MEMORY,
CVMX_PKO_PORT_ALREADY_SETUP,
CVMX_PKO_CMD_QUEUE_INIT_ERROR
-} cvmx_pko_status_t;
+};
enum cvmx_pow_tag_type {
CVMX_POW_TAG_TYPE_ORDERED = 0L,
@@ -1386,7 +1386,7 @@ static inline void cvmx_pko_send_packet_prepare(u64 port, u64 queue,
enum cvmx_pko_lock use_locking)
{ }
-static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(u64 port,
+static inline enum cvmx_pko_status cvmx_pko_send_packet_finish(u64 port,
u64 queue, union cvmx_pko_command_word0 pko_command,
union cvmx_buf_ptr packet, enum cvmx_pko_lock use_locking)
{
--
2.43.0