staging: octeon: Remove port status typedefs
PATCH v5 1/1 staging: octeon: Remove port status typedefs
Remove cvmx_pip_port_status_t and cvmx_pko_port_status_t typedefs and replace them with struct cvmx_pip_port_status and struct cvmx_pko_port_status to match Linux kernel coding style.
This also updates the MIPS architecture headers to name the structs so they can be referenced by the staging driver, resolving the build failure found in v2.
In v2, the anonymous struct definition in the header caused a compilation error when referenced in the driver. This patch names the structs in the headers and updates all usages to use the struct type directly, removing the typedefs as per coding style requirements.
---
Changes in v4:
- Completely removed typedefs (Greg KH). In v3, the struct was named but the typedef keyword was retained. Now uses struct directly.
- Clarified commit message regarding the robot report (it was a build failure due to anonymous structs, fixed by naming overlap with typedef removal).
Changes in v3:
- Address robot feedback.
Changes in v2:
- Initial attempt.
--- arch/mips/include/asm/octeon/cvmx-pip.h | 4 ++-- arch/mips/include/asm/octeon/cvmx-pko.h | 6 +++--- drivers/staging/octeon/ethernet.c | 4 ++-- drivers/staging/octeon/octeon-stubs.h | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-)
arch/mips/include/asm/octeon/cvmx-pip.h +2 -2
@@ -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;
arch/mips/include/asm/octeon/cvmx-pko.h +3 -3
@@ -114,11 +114,11 @@ typedef enum {CVMX_PKO_LOCK_CMD_QUEUE =2 , } cvmx_pko_lock_t; -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 +2 -2
@@ -201,8 +201,8 @@ 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_pip_port_status rx_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 +6 -6
@@ -386,7 +386,7 @@ union cvmx_ipd_sub_port_qos_cnt { } s; }; -typedef struct { +struct cvmx_pip_port_status {uint32_t dropped_octets;uint32_t dropped_packets;uint32_t pci_raw_packets;
@@ -409,13 +409,13 @@ typedef struct {uint32_t inb_packets;uint64_t inb_octets;uint16_t inb_errors; -} cvmx_pip_port_status_t; +}; -typedef struct { +struct cvmx_pko_port_status {uint32_t packets;uint64_t octets;uint64_t doorbell; -}cvmx_pko_port_status_t ; +};union cvmx_pip_frm_len_chkx {uint64_t u64;
@@ -1260,11 +1260,11 @@ static inline int octeon_is_simulation(void) }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) { }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) { } static inline cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
Signature · 1 line
2.43.0
Greg KH
maintainerQuoted 4 lines · Karthikey Kadati
Remove
cvmx_pip_port_status_tandcvmx_pko_port_status_ttypedefs and replace them with structcvmx_pip_port_statusand structcvmx_pko_port_statusto match Linux kernel coding style.
Quoted 8 lines
This also updates the MIPS architecture headers to name the structs so they can be referenced by the staging driver, resolving the build failure found in v2.
In v2, the anonymous struct definition in the header caused a compilation error when referenced in the driver. This patch names the structs in the headers and updates all usages to use the struct type directly, removing the typedefs as per coding style requirements.
This "V2" stuff doesn't need to be in the changelog text itself please. It goes below the --- line so it doesn't show up in the changelog when committed.
Quoted 12 lines
Signed-off-by Karthikey Kadati <[email protected]>---
Changes in v4:
- Completely removed typedefs (Greg KH). In v3, the struct was named but the typedef keyword was retained. Now uses struct directly.
- Clarified commit message regarding the robot report (it was a build failure due to anonymous structs, fixed by naming overlap with typedef removal).
Changes in v3:
- Address robot feedback.
Changes in v2:
- Initial attempt.
Wasn't v1 an initial attempt? :)
Quoted 12 lines
--- arch/mips/include/asm/octeon/cvmx-pip.h | 4 ++-- arch/mips/include/asm/octeon/cvmx-pko.h | 6 +++--- drivers/staging/octeon/ethernet.c | 4 ++-- drivers/staging/octeon/octeon-stubs.h | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-)arch/mips/include/asm/octeon/cvmx-pip.h +0
-0
arch/mips/include/asm/octeon/cvmx-pip.h typedef struct { · line 239
Quoted 5 lines
arch/mips/include/asm/octeon/cvmx-pip.h +1
-1@@ -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; +};
You aren't really removing the typedef here, are you ?
Take some time, relax, and think this all through as to what you are trying to do and how to do it. Also be sure you are able to properly build this code, as traditionally, this is a _VERY_ hard driver to test-build. It requires a cross-build to get right.
good luck!
greg k-h