Skip to contentSkip to conversation

staging: octeon: remove typedefs from octeon-stubs.h

PATCH In review Eric Wu 2 participants 2 messages Apr 26 – Apr 27 Staging

lore
Share & tools
lore

Eric Wu

author
#0 lore raw

PATCH 1/1 staging: octeon: remove typedefs from octeon-stubs.h

The Linux kernel coding style discourages the use of typedefs for enums and structs. checkpatch reports seven "do not add new typedefs" warnings on drivers/staging/octeon/octeon-stubs.h.

Drop the typedef wrappers in octeon-stubs.h and convert the affected users in ethernet.c and octeon-ethernet.h to use the underlying 'enum cvmx_*' / 'struct cvmx_*' tags directly.

No functional change. Compile-tested with CONFIG_COMPILE_TEST=y and CONFIG_OCTEON_ETHERNET=m on x86_64; both default and W=1 builds are clean.

---
 drivers/staging/octeon/ethernet.c        |  6 +--
 drivers/staging/octeon/octeon-ethernet.h |  2 +-
 drivers/staging/octeon/octeon-stubs.h    | 48 ++++++++++++------------
 3 files changed, 28 insertions(+), 28 deletions(-)
drivers/staging/octeon/ethernet.c +3 -3
index eadb74fc14c8..d85a9991faf6 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) {
@@ -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-ethernet.h +1 -1
index a6140705706f..d369c97c1332 100644
@@ -57,7 +57,7 @@ struct octeon_ethernet {
 	struct net_device *netdev;
 	/*
 	 * Type of port. This is one of the enums in
-	 * cvmx_helper_interface_mode_t
+	 * cvmx_helper_interface_mode
 	 */
 	int imode;
 	/* PHY mode */
drivers/staging/octeon/octeon-stubs.h +24 -24

135 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · Eric Wu

The Linux kernel coding style discourages the use of typedefs for enums and structs. checkpatch reports seven "do not add new typedefs" warnings on drivers/staging/octeon/octeon-stubs.h.

Drop the typedef wrappers in octeon-stubs.h and convert the affected users in ethernet.c and octeon-ethernet.h to use the underlying 'enum cvmx_*' / 'struct cvmx_*' tags directly.

No functional change. Compile-tested with CONFIG_COMPILE_TEST=y and CONFIG_OCTEON_ETHERNET=m on x86_64; both default and W=1 builds are clean.

As was stated to others attempting to do this, this should be a patch series, with one patch per enum changed, right?

thanks,

greg k-h