[PATCH v3] staging: octeon: Remove port status typedefs

Karthikey Kadati posted 1 patch 3 weeks, 3 days ago
There is a newer version of this 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(-)
[PATCH v3] staging: octeon: Remove port status typedefs
Posted by Karthikey Kadati 3 weeks, 3 days ago
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.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601131108.A90iCRFi-lkp@intel.com/
Signed-off-by: Karthikey Kadati <karthikey3608@gmail.com>
---
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(-)

diff --git a/arch/mips/include/asm/octeon/cvmx-pip.h b/arch/mips/include/asm/octeon/cvmx-pip.h
index 01ca7267a..cb3342313 100644
--- a/arch/mips/include/asm/octeon/cvmx-pip.h
+++ b/arch/mips/include/asm/octeon/cvmx-pip.h
@@ -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 */
diff --git a/arch/mips/include/asm/octeon/cvmx-pko.h b/arch/mips/include/asm/octeon/cvmx-pko.h
index f18a7f24d..46bb5ddcb 100644
--- a/arch/mips/include/asm/octeon/cvmx-pko.h
+++ b/arch/mips/include/asm/octeon/cvmx-pko.h
@@ -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;
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index eadb74fc1..6d03d2346 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -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) {
diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index 35b5078ba..f6d502193 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -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
-- 
2.43.0
Re: [PATCH v3] staging: octeon: Remove port status typedefs
Posted by Greg KH 3 weeks, 2 days ago
On Wed, Jan 14, 2026 at 10:28:34PM +0530, Karthikey Kadati wrote:
> 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.
> 
> Reported-by: kernel test robot <lkp@intel.com>

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

> Closes: https://lore.kernel.org/oe-kbuild-all/202601131108.A90iCRFi-lkp@intel.com/
> Signed-off-by: Karthikey Kadati <karthikey3608@gmail.com>
> ---
> 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(-)
> 
> diff --git a/arch/mips/include/asm/octeon/cvmx-pip.h b/arch/mips/include/asm/octeon/cvmx-pip.h
> index 01ca7267a..cb3342313 100644
> --- a/arch/mips/include/asm/octeon/cvmx-pip.h
> +++ b/arch/mips/include/asm/octeon/cvmx-pip.h
> @@ -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?


>  	/* Inbound octets marked to be dropped by the IPD */
>  	uint32_t dropped_octets;
>  	/* Inbound packets marked to be dropped by the IPD */
> diff --git a/arch/mips/include/asm/octeon/cvmx-pko.h b/arch/mips/include/asm/octeon/cvmx-pko.h
> index f18a7f24d..46bb5ddcb 100644
> --- a/arch/mips/include/asm/octeon/cvmx-pko.h
> +++ b/arch/mips/include/asm/octeon/cvmx-pko.h
> @@ -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