staging: octeon: remove typedefs for enums and structs
cover staging: octeon: remove typedefs for enums and structs
The staging octeon driver's TODO list includes "general code review and clean up". This series addresses that by removing unnecessary typedefs for enums and structs, converting them to plain types as required by the Linux kernel coding style (Documentation/process/coding-style.rst, section 5).
All typedefs ending in _t have been removed from the staging driver stubs (drivers/staging/octeon/octeon-stubs.h) and correspondingly updated in the arch/mips/ implementation headers and source files.
The series converts:
- 5 enum typedefs to plain enums:
cvmx_spi_mode_t, cvmx_helper_interface_mode_t, cvmx_pow_wait_t, cvmx_pko_lock_t, cvmx_pko_status_t
- 2 struct typedefs to plain structs:
cvmx_pko_port_status_t, cvmx_pip_port_status_t
No functional change intended. All patches have been compile-tested for both MIPS (cavium_octeon_defconfig) and x86_64 (with CONFIG_STAGING=y, CONFIG_OCTEON_ETHERNET=y, CONFIG_COMPILE_TEST=y).
Eric Wu (7):
staging: octeon: convert cvmx_spi_mode_t from typedef to plain enum
staging: octeon: convert cvmx_helper_interface_mode_t from typedef to
plain enum
staging: octeon: convert cvmx_pow_wait_t from typedef to plain enum
staging: octeon: convert cvmx_pko_lock_t from typedef to plain enum
staging: octeon: convert cvmx_pko_status_t from typedef to plain enum
staging: octeon: convert cvmx_pko_port_status_t from typedef to plain
struct
staging: octeon: convert cvmx_pip_port_status_t from typedef to plain
struct
.../executive/cvmx-helper-util.c | 2 +- .../cavium-octeon/executive/cvmx-helper.c | 8 ++-- arch/mips/cavium-octeon/executive/cvmx-pko.c | 6 +-- arch/mips/cavium-octeon/executive/cvmx-spi.c | 16 +++---- .../include/asm/octeon/cvmx-helper-util.h | 2 +- arch/mips/include/asm/octeon/cvmx-helper.h | 6 +-- arch/mips/include/asm/octeon/cvmx-pip.h | 6 +-- arch/mips/include/asm/octeon/cvmx-pko.h | 26 +++++----- arch/mips/include/asm/octeon/cvmx-pow.h | 12 ++--- arch/mips/include/asm/octeon/cvmx-spi.h | 38 +++++++-------- drivers/staging/octeon/ethernet.c | 6 +-- drivers/staging/octeon/octeon-stubs.h | 48 +++++++++---------- 12 files changed, 88 insertions(+), 88 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/7 staging: octeon: convert cvmx_spi_mode_t from typedef to plain enum
The Linux kernel coding style discourages the use of typedefs for enums. Convert cvmx_spi_mode_t to a plain 'enum cvmx_spi_mode' and update all users across the MIPS Octeon architecture code and the staging driver stubs.
This is part of a series converting all remaining enum typedefs in the octeon subsystem to plain enums, improving compliance with the kernel coding style.
No functional change.
--- arch/mips/cavium-octeon/executive/cvmx-spi.c | 16 ++++----- arch/mips/include/asm/octeon/cvmx-spi.h | 38 ++++++++++---------- drivers/staging/octeon/octeon-stubs.h | 6 ++-- 3 files changed, 30 insertions(+), 30 deletions(-)
arch/mips/cavium-octeon/executive/cvmx-spi.c +8 -8
@@ -102,7 +102,7 @@ void cvmx_spi_set_callbacks(cvmx_spi_callbacks_t *new_callbacks)* * Returns Zero on success, negative of failure. */ -int cvmx_spi_start_interface (int interface,cvmx_spi_mode_t mode,int timeout, +int cvmx_spi_start_interface (int interface,enum cvmx_spi_mode mode,int timeout,int num_ports) {int res =-1 ;
@@ -147,7 +147,7 @@ int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode, int timeout,* * Returns Zero on success, negative of failure. */ -int cvmx_spi_restart_interface (int interface,cvmx_spi_mode_t mode,int timeout) +int cvmx_spi_restart_interface (int interface,enum cvmx_spi_mode mode,int timeout) {int res =-1 ;
@@ -192,7 +192,7 @@ EXPORT_SYMBOL_GPL(cvmx_spi_restart_interface);* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -int cvmx_spi_reset_cb (int interface,cvmx_spi_mode_t mode) +int cvmx_spi_reset_cb (int interface,enum cvmx_spi_mode mode) {union cvmx_spxx_dbg_deskew_ctl spxx_dbg_deskew_ctl;union cvmx_spxx_clk_ctl spxx_clk_ctl;
@@ -308,7 +308,7 @@ int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode)* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -int cvmx_spi_calendar_setup_cb (int interface,cvmx_spi_mode_t mode, +int cvmx_spi_calendar_setup_cb (int interface,enum cvmx_spi_mode mode,int num_ports) {int port;
@@ -427,7 +427,7 @@ int cvmx_spi_calendar_setup_cb(int interface, cvmx_spi_mode_t mode,* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -int cvmx_spi_clock_detect_cb (int interface,cvmx_spi_mode_t mode,int timeout) +int cvmx_spi_clock_detect_cb (int interface,enum cvmx_spi_mode mode,int timeout) {int clock_transitions;union cvmx_spxx_clk_stat stat;
@@ -505,7 +505,7 @@ int cvmx_spi_clock_detect_cb(int interface, cvmx_spi_mode_t mode, int timeout)* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -int cvmx_spi_training_cb (int interface,cvmx_spi_mode_t mode,int timeout) +int cvmx_spi_training_cb (int interface,enum cvmx_spi_mode mode,int timeout) {union cvmx_spxx_trn4_ctl spxx_trn4_ctl;union cvmx_spxx_clk_stat stat;
@@ -574,7 +574,7 @@ int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, int timeout)* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -int cvmx_spi_calendar_sync_cb (int interface,cvmx_spi_mode_t mode,int timeout) +int cvmx_spi_calendar_sync_cb (int interface,enum cvmx_spi_mode mode,int timeout) {uint64_t MS =cvmx_sysinfo_get ()->cpu_clock_hz /1000 ;if (mode &CVMX_SPI_MODE_RX_HALFPLEX ) {
@@ -630,7 +630,7 @@ int cvmx_spi_calendar_sync_cb(int interface, cvmx_spi_mode_t mode, int timeout)* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -int cvmx_spi_interface_up_cb (int interface,cvmx_spi_mode_t mode) +int cvmx_spi_interface_up_cb (int interface,enum cvmx_spi_mode mode) {union cvmx_gmxx_rxx_frm_min gmxx_rxx_frm_min;union cvmx_gmxx_rxx_frm_max gmxx_rxx_frm_max;
arch/mips/include/asm/octeon/cvmx-spi.h +19 -19
@@ -36,35 +36,35 @@/* CSR typedefs have been moved to cvmx-csr-*.h */ -typedef enum { +enum cvmx_spi_mode {CVMX_SPI_MODE_UNKNOWN =0 ,CVMX_SPI_MODE_TX_HALFPLEX =1 ,CVMX_SPI_MODE_RX_HALFPLEX =2 ,CVMX_SPI_MODE_DUPLEX =3 -}cvmx_spi_mode_t ; +};/** Callbacks structure to customize SPI4 initialization sequence */ typedef struct {/** Called to reset SPI4 DLL */ -int (*reset_cb) (int interface,cvmx_spi_mode_t mode); +int (*reset_cb)(int interface,enum cvmx_spi_mode mode);/** Called to setup calendar */ -int (*calendar_setup_cb) (int interface,cvmx_spi_mode_t mode, -int num_ports); +int (*calendar_setup_cb)(int interface,enum cvmx_spi_mode mode, +int num_ports);/** Called for Tx and Rx clock detection */ -int (*clock_detect_cb) (int interface,cvmx_spi_mode_t mode, -int timeout); +int (*clock_detect_cb)(int interface,enum cvmx_spi_mode mode, +int timeout);/** Called to perform link training */ -int (*training_cb) (int interface,cvmx_spi_mode_t mode,int timeout); +int (*training_cb)(int interface,enum cvmx_spi_mode mode,int timeout);/** Called for calendar data synchronization */ -int (*calendar_sync_cb) (int interface,cvmx_spi_mode_t mode, -int timeout); +int (*calendar_sync_cb)(int interface,enum cvmx_spi_mode mode, +int timeout);/** Called when interface is up */ -int (*interface_up_cb) (int interface,cvmx_spi_mode_t mode); +int (*interface_up_cb)(int interface,enum cvmx_spi_mode mode); }cvmx_spi_callbacks_t ;
@@ -94,7 +94,7 @@ static inline int cvmx_spi_is_spi_interface(int interface)* * Returns Zero on success, negative of failure. */ -extern int cvmx_spi_start_interface (int interface,cvmx_spi_mode_t mode, +extern int cvmx_spi_start_interface (int interface,enum cvmx_spi_mode mode,int timeout,int num_ports);/**
@@ -110,7 +110,7 @@ extern int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode,* @timeout: Timeout to wait for clock synchronization in seconds * Returns Zero on success, negative of failure. */ -extern int cvmx_spi_restart_interface (int interface,cvmx_spi_mode_t mode, +extern int cvmx_spi_restart_interface (int interface,enum cvmx_spi_mode mode,int timeout);/**
@@ -180,7 +180,7 @@ extern void cvmx_spi_set_callbacks(cvmx_spi_callbacks_t *new_callbacks);* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_reset_cb (int interface,cvmx_spi_mode_t mode); +extern int cvmx_spi_reset_cb (int interface,enum cvmx_spi_mode mode);/** * Callback to setup calendar and miscellaneous settings before clock
@@ -197,7 +197,7 @@ extern int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode);* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_calendar_setup_cb (int interface,cvmx_spi_mode_t mode, +extern int cvmx_spi_calendar_setup_cb (int interface,enum cvmx_spi_mode mode,int num_ports);/**
@@ -214,7 +214,7 @@ extern int cvmx_spi_calendar_setup_cb(int interface, cvmx_spi_mode_t mode,* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_clock_detect_cb (int interface,cvmx_spi_mode_t mode, +extern int cvmx_spi_clock_detect_cb (int interface,enum cvmx_spi_mode mode,int timeout);/**
@@ -231,7 +231,7 @@ extern int cvmx_spi_clock_detect_cb(int interface, cvmx_spi_mode_t mode,* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_training_cb (int interface,cvmx_spi_mode_t mode, +extern int cvmx_spi_training_cb (int interface,enum cvmx_spi_mode mode,int timeout);/**
@@ -248,7 +248,7 @@ extern int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode,* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_calendar_sync_cb (int interface,cvmx_spi_mode_t mode, +extern int cvmx_spi_calendar_sync_cb (int interface,enum cvmx_spi_mode mode,int timeout);/**
@@ -264,6 +264,6 @@ extern int cvmx_spi_calendar_sync_cb(int interface, cvmx_spi_mode_t mode,* Returns Zero on success, non-zero error code on failure (will cause * SPI initialization to abort) */ -extern int cvmx_spi_interface_up_cb (int interface,cvmx_spi_mode_t mode); +extern int cvmx_spi_interface_up_cb (int interface,enum cvmx_spi_mode mode);#endif /* __CVMX_SPI_H__ */
drivers/staging/octeon/octeon-stubs.h +3 -3
@@ -215,12 +215,12 @@ enum cvmx_fau_op_size {CVMX_FAU_OP_SIZE_64 =3 }; -typedef enum { +enum cvmx_spi_mode {CVMX_SPI_MODE_UNKNOWN =0 ,CVMX_SPI_MODE_TX_HALFPLEX =1 ,CVMX_SPI_MODE_RX_HALFPLEX =2 ,CVMX_SPI_MODE_DUPLEX =3 -}cvmx_spi_mode_t ; +}; typedef enum { CVMX_HELPER_INTERFACE_MODE_DISABLED,
@@ -1364,7 +1364,7 @@ static inline struct cvmx_wqe *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait) }static inline int cvmx_spi_restart_interface (int interface, -cvmx_spi_mode_t mode,int timeout) +enum cvmx_spi_mode mode,int timeout) {return 0 ; }
Signature · 1 line
2.43.0
PATCH 2/7 staging: octeon: convert cvmx_helper_interface_mode_t from typedef to plain enum
In reply to Eric WuThe 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.
--- 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(-)
arch/mips/cavium-octeon/executive/cvmx-helper-util.c +1 -1
@@ -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) {
arch/mips/cavium-octeon/executive/cvmx-helper.c +4 -4
@@ -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;
arch/mips/cavium-octeon/executive/cvmx-pko.c +1 -1
@@ -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;/*
arch/mips/include/asm/octeon/cvmx-helper-util.h +1 -1
@@ -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.
arch/mips/include/asm/octeon/cvmx-helper.h +3 -3
@@ -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);/**
drivers/staging/octeon/ethernet.c +1 -1
@@ -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;
drivers/staging/octeon/octeon-stubs.h +3 -3
@@ -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 ;
Signature · 1 line
2.43.0
PATCH 3/7 staging: octeon: convert cvmx_pow_wait_t from typedef to plain enum
In reply to Eric WuThe Linux kernel coding style discourages the use of typedefs for enums. Convert cvmx_pow_wait_t to a plain 'enum cvmx_pow_wait' and update all users across the MIPS Octeon architecture code and the staging driver stubs.
No functional change.
--- arch/mips/include/asm/octeon/cvmx-pow.h | 12 ++++++------ drivers/staging/octeon/octeon-stubs.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-)
arch/mips/include/asm/octeon/cvmx-pow.h +6 -6
@@ -84,10 +84,10 @@ enum cvmx_pow_tag_type {/** * Wait flag values for pow functions. */ -typedef enum { +enum cvmx_pow_wait {CVMX_POW_WAIT =1 ,CVMX_POW_NO_WAIT =0 , -}cvmx_pow_wait_t ; +};/** * POW tag operations. These are used in the data stored to the POW.
@@ -1348,7 +1348,7 @@ static inline void cvmx_pow_tag_sw_wait(void)* Returns: the WQE pointer from POW. Returns NULL if no work * was available. */ -static inline struct cvmx_wqe *cvmx_pow_work_request_sync_nocheck (cvmx_pow_wait_t +static inline struct cvmx_wqe *cvmx_pow_work_request_sync_nocheck (enum cvmx_pow_wait wait) {cvmx_pow_load_addr_t ptr;
@@ -1382,7 +1382,7 @@ static inline struct cvmx_wqe *cvmx_pow_work_request_sync_nocheck(cvmx_pow_wait_* Returns: the WQE pointer from POW. Returns NULL if no work * was available. */ -static inline struct cvmx_wqe *cvmx_pow_work_request_sync (cvmx_pow_wait_t wait) +static inline struct cvmx_wqe *cvmx_pow_work_request_sync (enum cvmx_pow_wait wait) {if (CVMX_ENABLE_POW_CHECKS )__cvmx_pow_warn_if_pending_switch (__func__);
@@ -1436,7 +1436,7 @@ static inline enum cvmx_pow_tag_type cvmx_pow_work_request_null_rd(void)* timeout), 0 to cause response to return immediately */ static inline void cvmx_pow_work_request_async_nocheck (int scr_addr, -cvmx_pow_wait_t wait) +enum cvmx_pow_wait wait) {cvmx_pow_iobdma_store_t data;
@@ -1465,7 +1465,7 @@ static inline void cvmx_pow_work_request_async_nocheck(int scr_addr,* timeout), 0 to cause response to return immediately */ static inline void cvmx_pow_work_request_async (int scr_addr, -cvmx_pow_wait_t wait) +enum cvmx_pow_wait wait) {if (CVMX_ENABLE_POW_CHECKS )__cvmx_pow_warn_if_pending_switch (__func__);
drivers/staging/octeon/octeon-stubs.h +5 -5
@@ -235,10 +235,10 @@ enum cvmx_helper_interface_mode { CVMX_HELPER_INTERFACE_MODE_LOOP, }; -typedef enum { +enum cvmx_pow_wait {CVMX_POW_WAIT =1 ,CVMX_POW_NO_WAIT =0 , -}cvmx_pow_wait_t ; +}; typedef enum { CVMX_PKO_LOCK_NONE = 0,
@@ -1344,11 +1344,11 @@ static inline unsigned int cvmx_get_core_num(void) }static inline void cvmx_pow_work_request_async_nocheck (int scr_addr, -cvmx_pow_wait_t wait) +enum cvmx_pow_wait wait) { }static inline void cvmx_pow_work_request_async (int scr_addr, -cvmx_pow_wait_t wait) +enum cvmx_pow_wait wait) { }static inline struct cvmx_wqe *cvmx_pow_work_response_async (int scr_addr)
@@ -1358,7 +1358,7 @@ static inline struct cvmx_wqe *cvmx_pow_work_response_async(int scr_addr)return wqe; } -static inline struct cvmx_wqe *cvmx_pow_work_request_sync (cvmx_pow_wait_t wait) +static inline struct cvmx_wqe *cvmx_pow_work_request_sync (enum cvmx_pow_wait wait) {return (void *)(unsigned long )wait; }
Signature · 1 line
2.43.0
PATCH 4/7 staging: octeon: convert cvmx_pko_lock_t from typedef to plain enum
In reply to Eric WuThe Linux kernel coding style discourages the use of typedefs for enums. Convert cvmx_pko_lock_t to a plain 'enum cvmx_pko_lock' and update all users across the MIPS Octeon architecture code and the staging driver stubs.
No functional change.
--- arch/mips/include/asm/octeon/cvmx-pko.h | 10 +++++----- drivers/staging/octeon/octeon-stubs.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-)
arch/mips/include/asm/octeon/cvmx-pko.h +5 -5
@@ -93,7 +93,7 @@ typedef enum {/** * This enumeration represents the different locking modes supported by PKO. */ -typedef enum { +enum cvmx_pko_lock {/* * PKO doesn't do any locking. It is the responsibility of the * application to make sure that no other core is accessing
@@ -112,7 +112,7 @@ typedef enum {* ll/sc. This is the most portable locking mechanism. */ CVMX_PKO_LOCK_CMD_QUEUE = 2, -} cvmx_pko_lock_t; +}; typedef struct { uint32_t packets;
@@ -374,7 +374,7 @@ static inline void cvmx_pko_doorbell(uint64_t port, uint64_t queue,*/ static inline void cvmx_pko_send_packet_prepare (uint64_t port,uint64_t queue, -cvmx_pko_lock_t use_locking) +enum cvmx_pko_lock use_locking) {if (use_locking ==CVMX_PKO_LOCK_ATOMIC_TAG ) {/*
@@ -419,7 +419,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t queue, union cvmx_pko_command_word0 pko_command, union cvmx_buf_ptr packet, - cvmx_pko_lock_t use_locking) + enum cvmx_pko_lock use_locking) { cvmx_cmd_queue_result_t result;if (use_locking ==CVMX_PKO_LOCK_ATOMIC_TAG )
@@ -463,7 +463,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish3(union cvmx_pko_command_word0 pko_command, union cvmx_buf_ptr packet, uint64_t addr, - cvmx_pko_lock_t use_locking) + enum cvmx_pko_lock use_locking) { cvmx_cmd_queue_result_t result;if (use_locking ==CVMX_PKO_LOCK_ATOMIC_TAG )
drivers/staging/octeon/octeon-stubs.h +4 -4
@@ -240,11 +240,11 @@ enum cvmx_pow_wait { CVMX_POW_NO_WAIT = 0, }; -typedef enum { +enum cvmx_pko_lock {CVMX_PKO_LOCK_NONE =0 ,CVMX_PKO_LOCK_ATOMIC_TAG =1 ,CVMX_PKO_LOCK_CMD_QUEUE =2 , -}cvmx_pko_lock_t ; +}; typedef enum { CVMX_PKO_SUCCESS,
@@ -1383,12 +1383,12 @@ static inline union cvmx_gmxx_rxx_rx_inbnd cvmx_spi4000_check_speed(int interfac }static inline void cvmx_pko_send_packet_prepare (u64 port,u64 queue, -cvmx_pko_lock_t use_locking) +enum cvmx_pko_lock use_locking) { }static inline cvmx_pko_status_t cvmx_pko_send_packet_finish (u64 port,u64 queue,union cvmx_pko_command_word0 pko_command, -union cvmx_buf_ptr packet,cvmx_pko_lock_t use_locking) +union cvmx_buf_ptr packet,enum cvmx_pko_lock use_locking) {return 0 ; }
Signature · 1 line
2.43.0
PATCH 5/7 staging: octeon: convert cvmx_pko_status_t from typedef to plain enum
In reply to Eric WuThe 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.
--- 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(-)
arch/mips/cavium-octeon/executive/cvmx-pko.c +2 -2
@@ -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;
arch/mips/include/asm/octeon/cvmx-pko.h +5 -5
@@ -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,
drivers/staging/octeon/octeon-stubs.h +3 -3
@@ -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) {
Signature · 1 line
2.43.0
PATCH 6/7 staging: octeon: convert cvmx_pko_port_status_t from typedef to plain struct
In reply to Eric WuThe Linux kernel coding style discourages the use of typedefs for structs. Convert cvmx_pko_port_status_t to a plain 'struct cvmx_pko_port_status' and update all users across the MIPS Octeon architecture code and the staging driver.
No functional change.
--- arch/mips/include/asm/octeon/cvmx-pko.h | 6 +++--- drivers/staging/octeon/ethernet.c | 2 +- drivers/staging/octeon/octeon-stubs.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/include/asm/octeon/cvmx-pko.h +3 -3
@@ -114,11 +114,11 @@ enum cvmx_pko_lock { CVMX_PKO_LOCK_CMD_QUEUE = 2, }; -typedef struct { +struct cvmx_pko_port_status {uint32_t packets;uint64_t octets;uint64_t doorbell; -}cvmx_pko_port_status_t ; +};/** * This structure defines the address to use on a packet enqueue
@@ -574,7 +574,7 @@ static inline int cvmx_pko_get_num_queues(int port)* @status: Where to put the results. */ static inline void cvmx_pko_get_port_status (uint64_t port_num,uint64_t clear, -cvmx_pko_port_status_t *status) +struct cvmx_pko_port_status *status) {union cvmx_pko_reg_read_idx pko_reg_read_idx;union cvmx_pko_mem_count0 pko_mem_count0;
drivers/staging/octeon/ethernet.c +1 -1
@@ -202,7 +202,7 @@ EXPORT_SYMBOL(cvm_oct_free_work);static struct net_device_stats *cvm_oct_common_get_stats (struct net_device *dev) {cvmx_pip_port_status_t rx_status; -cvmx_pko_port_status_t tx_status; +struct cvmx_pko_port_status tx_status;struct octeon_ethernet *priv =netdev_priv (dev);if (priv->port <CVMX_PIP_NUM_INPUT_PORTS ) {
drivers/staging/octeon/octeon-stubs.h +3 -3
@@ -411,11 +411,11 @@ typedef struct {u16 inb_errors; } cvmx_pip_port_status_t; -typedef struct { +struct cvmx_pko_port_status {u32 packets;u64 octets;u64 doorbell; -}cvmx_pko_port_status_t ; +};union cvmx_pip_frm_len_chkx {u64 u64;
@@ -1264,7 +1264,7 @@ static inline void cvmx_pip_get_port_status(u64 port_num, u64 clear, { }static inline void cvmx_pko_get_port_status (u64 port_num,u64 clear, -cvmx_pko_port_status_t *status) +struct cvmx_pko_port_status *status) { } static inline enum cvmx_helper_interface_mode cvmx_helper_interface_get_mode(int
Signature · 1 line
2.43.0
PATCH 7/7 staging: octeon: convert cvmx_pip_port_status_t from typedef to plain struct
In reply to Eric WuThe Linux kernel coding style discourages the use of typedefs for structs. Convert cvmx_pip_port_status_t to a plain 'struct cvmx_pip_port_status' and update all users across the MIPS Octeon architecture code and the staging driver.
No functional change.
--- arch/mips/include/asm/octeon/cvmx-pip.h | 6 +++--- drivers/staging/octeon/ethernet.c | 2 +- drivers/staging/octeon/octeon-stubs.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/include/asm/octeon/cvmx-pip.h +3 -3
@@ -180,7 +180,7 @@ typedef union {/** * Status statistics for a port */ -typedef struct { +struct cvmx_pip_port_status {/* Inbound octets marked to be dropped by the IPD */ uint32_t dropped_octets;/* Inbound packets marked to be dropped by the IPD */
@@ -236,7 +236,7 @@ typedef struct {uint64_t inb_octets;/* Number of packets with GMX/SPX/PCI errors received by PIP */ uint16_t inb_errors; -} cvmx_pip_port_status_t; +};/** * Definition of the PIP custom header that can be prepended
@@ -365,7 +365,7 @@ static inline void cvmx_pip_config_diffserv_qos(uint64_t diffserv, uint64_t qos)* @status: Where to put the results. */ static inline void cvmx_pip_get_port_status (uint64_t port_num,uint64_t clear, -cvmx_pip_port_status_t *status) +struct cvmx_pip_port_status *status) {union cvmx_pip_stat_ctl pip_stat_ctl;union cvmx_pip_stat0_prtx stat0;
drivers/staging/octeon/ethernet.c +1 -1
@@ -201,7 +201,7 @@ EXPORT_SYMBOL(cvm_oct_free_work);*/ static struct net_device_stats *cvm_oct_common_get_stats (struct net_device *dev) { -cvmx_pip_port_status_t rx_status; +struct cvmx_pip_port_status rx_status;struct cvmx_pko_port_status tx_status;struct octeon_ethernet *priv =netdev_priv (dev);
drivers/staging/octeon/octeon-stubs.h +3 -3
@@ -386,7 +386,7 @@ union cvmx_ipd_sub_port_qos_cnt { } s; }; -typedef struct { +struct cvmx_pip_port_status {u32 dropped_octets;u32 dropped_packets;u32 pci_raw_packets;
@@ -409,7 +409,7 @@ typedef struct {u32 inb_packets;u64 inb_octets;u16 inb_errors; -} cvmx_pip_port_status_t; +};struct cvmx_pko_port_status {u32 packets;
@@ -1260,7 +1260,7 @@ static inline int octeon_is_simulation(void) }static inline void cvmx_pip_get_port_status (u64 port_num,u64 clear, -cvmx_pip_port_status_t *status) +struct cvmx_pip_port_status *status) { } static inline void cvmx_pko_get_port_status(u64 port_num, u64 clear,
Signature · 1 line
2.43.0