Skip to contentSkip to conversation

staging: octeon: Remove port status typedefs

PATCH Superseded Karthikey Kadati 2 participants 2 messages Jan 14 – Jan 15

Subsystems (2)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 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 anonymous structs so they can be referenced by the staging driver.

---
v3:
- Fix build failure by naming anonymous structs in MIPS headers (Reported by kernel test robot).
- Add Reported-by and Closes tags.
v2:
- Remove invalid "Unix Antigravity" Signed-off-by.
- Submit as standalone patch (detached from unrelated series).

 arch/mips/include/asm/octeon/cvmx-pip.h |  2 +-
 arch/mips/include/asm/octeon/cvmx-pko.h |  2 +-
 drivers/staging/octeon/ethernet.c       |  4 ++--
 drivers/staging/octeon/octeon-stubs.h   | 12 ++++++------
 4 files changed, 10 insertions(+), 10 deletions(-)
arch/mips/include/asm/octeon/cvmx-pip.h +1 -1
index 01ca7267a..cb3342313 100644
@@ -180,7 +180,7 @@ typedef union {
 /**
  * Status statistics for a port
  */
-typedef struct {
+typedef 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 */
arch/mips/include/asm/octeon/cvmx-pko.h +1 -1
index f18a7f24d..46bb5ddcb 100644
@@ -114,7 +114,7 @@ typedef enum {
 	CVMX_PKO_LOCK_CMD_QUEUE = 2,
 } cvmx_pko_lock_t;
 
-typedef struct {
+typedef struct cvmx_pko_port_status {
 	uint32_t packets;
 	uint64_t octets;
 	uint64_t doorbell;
drivers/staging/octeon/ethernet.c +2 -2
index eadb74fc1..6d03d2346 100644
@@ -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
index 35b5078ba..f6d502193 100644
@@ -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
maintainer
#1 lore raw
Quoted 8 lines · Karthikey Kadati

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 anonymous structs so they can be referenced by the staging driver.

The test robot reported that typedefs need to be removed? Or did it just find a failure in your previous change?

Quoted 22 lines

---
v3:
- Fix build failure by naming anonymous structs in MIPS headers (Reported by kernel test robot).
- Add Reported-by and Closes tags.
v2:
- Remove invalid "Unix Antigravity" Signed-off-by.
- Submit as standalone patch (detached from unrelated series).

 arch/mips/include/asm/octeon/cvmx-pip.h |  2 +-
 arch/mips/include/asm/octeon/cvmx-pko.h |  2 +-
 drivers/staging/octeon/ethernet.c       |  4 ++--
 drivers/staging/octeon/octeon-stubs.h   | 12 ++++++------
 4 files changed, 10 insertions(+), 10 deletions(-)
arch/mips/include/asm/octeon/cvmx-pip.h +0 -0
index 01ca7267a..cb3342313 100644

arch/mips/include/asm/octeon/cvmx-pip.h typedef union { · line 183

Quoted 5 lines
arch/mips/include/asm/octeon/cvmx-pip.h +1 -1
@@ -180,7 +180,7 @@ typedef union {
 /**
  * Status statistics for a port
  */
-typedef struct {
+typedef struct cvmx_pip_port_status {

Why is this typedef left here?

arch/mips/include/asm/octeon/cvmx-pko.h typedef enum { · line 117

Quoted 13 lines
arch/mips/include/asm/octeon/cvmx-pip.h +0 -0
 	/* Inbound octets marked to be dropped by the IPD */
 	uint32_t dropped_octets;
 	/* Inbound packets marked to be dropped by the IPD */
arch/mips/include/asm/octeon/cvmx-pko.h +1 -1
index f18a7f24d..46bb5ddcb 100644
@@ -114,7 +114,7 @@ typedef enum {
 	CVMX_PKO_LOCK_CMD_QUEUE = 2,
 } cvmx_pko_lock_t;
 
-typedef struct {
+typedef struct cvmx_pko_port_status {

Same here, I thought you were removing typedefs?

thanks,

greg k-h