All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: octeon: fix style issues in ethernet.c
       [not found] <20260821041255.1616843-1-tiago.panizio@hotmail.com>
@ 2026-08-21  4:12 ` Tiago Panizio Gottardo
  2026-08-21  6:58   ` Dan Carpenter
  2026-08-21  4:12 ` [PATCH 2/3] staging: octeon: fix RGMII condition formatting Tiago Panizio Gottardo
  2026-08-21  4:12 ` [PATCH 3/3] staging: octeon: remove unnecessary parentheses Tiago Panizio Gottardo
  2 siblings, 1 reply; 5+ messages in thread
From: Tiago Panizio Gottardo @ 2026-08-21  4:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tiago Panizio Gottardo

Fix several coding style issues in ethernet.c, including line wrapping,
continuation alignment and function declaration formatting.

No functional changes intended.

Signed-off-by: Tiago Panizio Gottardo <tiago.panizio@hotmail.com>
---
 drivers/staging/octeon/ethernet.c | 308 +++++++++++++++---------------
 1 file changed, 157 insertions(+), 151 deletions(-)

diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 42ec4b8324a8..4557893bbba4 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -32,55 +32,61 @@
 
 static int num_packet_buffers = 1024;
 module_param(num_packet_buffers, int, 0444);
-MODULE_PARM_DESC(num_packet_buffers, "\n"
-	"\tNumber of packet buffers to allocate and store in the\n"
-	"\tFPA. By default, 1024 packet buffers are used.\n");
+MODULE_PARM_DESC(num_packet_buffers,
+		 "\n"
+		 "\tNumber of packet buffers to allocate and store in the\n"
+		 "\tFPA. By default, 1024 packet buffers are used.\n");
 
 static int pow_receive_group = 15;
 module_param(pow_receive_group, int, 0444);
-MODULE_PARM_DESC(pow_receive_group, "\n"
-	"\tPOW group to receive packets from. All ethernet hardware\n"
-	"\twill be configured to send incoming packets to this POW\n"
-	"\tgroup. Also any other software can submit packets to this\n"
-	"\tgroup for the kernel to process.");
+MODULE_PARM_DESC(pow_receive_group,
+		 "\n"
+		 "\tPOW group to receive packets from. All ethernet hardware\n"
+		 "\twill be configured to send incoming packets to this POW\n"
+		 "\tgroup. Also any other software can submit packets to this\n"
+		 "\tgroup for the kernel to process.");
 
 static int receive_group_order;
 module_param(receive_group_order, int, 0444);
-MODULE_PARM_DESC(receive_group_order, "\n"
-	"\tOrder (0..4) of receive groups to take into use. Ethernet hardware\n"
-	"\twill be configured to send incoming packets to multiple POW\n"
-	"\tgroups. pow_receive_group parameter is ignored when multiple\n"
-	"\tgroups are taken into use and groups are allocated starting\n"
-	"\tfrom 0. By default, a single group is used.\n");
+MODULE_PARM_DESC(receive_group_order,
+		 "\n"
+		 "\tOrder (0..4) of receive groups to take into use. Ethernet hardware\n"
+		 "\twill be configured to send incoming packets to multiple POW\n"
+		 "\tgroups. pow_receive_group parameter is ignored when multiple\n"
+		 "\tgroups are taken into use and groups are allocated starting\n"
+		 "\tfrom 0. By default, a single group is used.\n");
 
 int pow_send_group = -1;
 module_param(pow_send_group, int, 0644);
-MODULE_PARM_DESC(pow_send_group, "\n"
-	"\tPOW group to send packets to other software on. This\n"
-	"\tcontrols the creation of the virtual device pow0.\n"
-	"\talways_use_pow also depends on this value.");
+MODULE_PARM_DESC(pow_send_group,
+		 "\n"
+		 "\tPOW group to send packets to other software on. This\n"
+		 "\tcontrols the creation of the virtual device pow0.\n"
+		 "\talways_use_pow also depends on this value.");
 
 int always_use_pow;
 module_param(always_use_pow, int, 0444);
-MODULE_PARM_DESC(always_use_pow, "\n"
-	"\tWhen set, always send to the pow group. This will cause\n"
-	"\tpackets sent to real ethernet devices to be sent to the\n"
-	"\tPOW group instead of the hardware. Unless some other\n"
-	"\tapplication changes the config, packets will still be\n"
-	"\treceived from the low level hardware. Use this option\n"
-	"\tto allow a CVMX app to intercept all packets from the\n"
-	"\tlinux kernel. You must specify pow_send_group along with\n"
-	"\tthis option.");
+MODULE_PARM_DESC(always_use_pow,
+		 "\n"
+		 "\tWhen set, always send to the pow group. This will cause\n"
+		 "\tpackets sent to real ethernet devices to be sent to the\n"
+		 "\tPOW group instead of the hardware. Unless some other\n"
+		 "\tapplication changes the config, packets will still be\n"
+		 "\treceived from the low level hardware. Use this option\n"
+		 "\tto allow a CVMX app to intercept all packets from the\n"
+		 "\tlinux kernel. You must specify pow_send_group along with\n"
+		 "\tthis option.");
 
 char pow_send_list[128] = "";
 module_param_string(pow_send_list, pow_send_list, sizeof(pow_send_list), 0444);
-MODULE_PARM_DESC(pow_send_list, "\n"
-	"\tComma separated list of ethernet devices that should use the\n"
-	"\tPOW for transmit instead of the actual ethernet hardware. This\n"
-	"\tis a per port version of always_use_pow. always_use_pow takes\n"
-	"\tprecedence over this list. For example, setting this to\n"
-	"\t\"eth2,spi3,spi7\" would cause these three devices to transmit\n"
-	"\tusing the pow_send_group.");
+MODULE_PARM_DESC(pow_send_list,
+		 "\n"
+		 "\tComma separated list of ethernet devices that should use the\n"
+		 "\tPOW for transmit instead of the actual ethernet hardware. This\n"
+		 "\tis a per port version of always_use_pow. always_use_pow takes\n"
+		 "\tprecedence over this list. For example, setting this to\n"
+		 "\t\"eth2,spi3,spi7\" would cause these three devices to transmit\n"
+		 "\tusing the pow_send_group.");
 
 int rx_napi_weight = 32;
 module_param(rx_napi_weight, int, 0444);
@@ -122,7 +128,8 @@ static void cvm_oct_remove_device(int port)
 static void cvm_oct_rx_refill_worker(struct work_struct *work)
 {
 	struct octeon_ethernet_platform *plat = container_of(work,
-		struct octeon_ethernet_platform, rx_refill_work.work);
+							     struct octeon_ethernet_platform,
+							     rx_refill_work.work);
 	/*
 	 * FPA 0 may have been drained, try to refill it if we need
 	 * more than num_packet_buffers / 2, otherwise normal receive
@@ -145,8 +152,7 @@ static void cvm_oct_periodic_worker(struct work_struct *work)
 	if (priv->poll)
 		priv->poll(cvm_oct_device[priv->port]);
 
-	cvm_oct_device[priv->port]->netdev_ops->ndo_get_stats
-						(cvm_oct_device[priv->port]);
+	cvm_oct_device[priv->port]->netdev_ops->ndo_get_stats(cvm_oct_device[priv->port]);
 
 	if (!atomic_read(&cvm_oct_poll_queue_stopping))
 		schedule_delayed_work(&priv->port_periodic_work, HZ);
@@ -156,8 +162,8 @@ static void cvm_oct_configure_common_hw(struct platform_device *pdev)
 {
 	/* Setup the FPA */
 	cvmx_fpa_enable();
-	cvm_oct_mem_fill_fpa(pdev, CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE,
-			     num_packet_buffers);
+	cvm_oct_mem_fill_fpa(pdev, CVMX_FPA_PACKET_POOL,
+			     CVMX_FPA_PACKET_POOL_SIZE, num_packet_buffers);
 	cvm_oct_mem_fill_fpa(pdev, CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE,
 			     num_packet_buffers);
 	if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
@@ -193,8 +199,8 @@ int cvm_oct_free_work(void *work_queue_entry)
 	union cvmx_buf_ptr segment_ptr = work->packet_ptr;
 
 	while (segments--) {
-		union cvmx_buf_ptr next_ptr = *(union cvmx_buf_ptr *)
-			cvmx_phys_to_ptr(segment_ptr.s.addr - 8);
+		union cvmx_buf_ptr next_ptr =
+			*(union cvmx_buf_ptr *)cvmx_phys_to_ptr(segment_ptr.s.addr - 8);
 		if (unlikely(!segment_ptr.s.i))
 			cvmx_fpa_free(cvm_oct_get_buffer_ptr(segment_ptr),
 				      segment_ptr.s.pool,
@@ -262,9 +268,8 @@ static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
 
 	dev->mtu = new_mtu;
 
-	if ((interface < 2) &&
-	    (cvmx_helper_interface_get_mode(interface) !=
-		CVMX_HELPER_INTERFACE_MODE_SPI)) {
+	if (interface < 2 && cvmx_helper_interface_get_mode(interface) !=
+				     CVMX_HELPER_INTERFACE_MODE_SPI) {
 		int index = INDEX(priv->port);
 		/* Add ethernet header and FCS, and VLAN if configured. */
 		int max_packet = new_mtu + mtu_overhead;
@@ -308,14 +313,13 @@ static void cvm_oct_common_set_multicast_list(struct net_device *dev)
 	struct octeon_ethernet *priv = netdev_priv(dev);
 	int interface = INTERFACE(priv->port);
 
-	if ((interface < 2) &&
-	    (cvmx_helper_interface_get_mode(interface) !=
-		CVMX_HELPER_INTERFACE_MODE_SPI)) {
+	if (interface < 2 && cvmx_helper_interface_get_mode(interface) !=
+				CVMX_HELPER_INTERFACE_MODE_SPI) {
 		union cvmx_gmxx_rxx_adr_ctl control;
 		int index = INDEX(priv->port);
 
 		control.u64 = 0;
-		control.s.bcst = 1;	/* Allow broadcast MAC addresses */
+		control.s.bcst = 1; /* Allow broadcast MAC addresses */
 
 		if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI) ||
 		    (dev->flags & IFF_PROMISC))
@@ -336,18 +340,16 @@ static void cvm_oct_common_set_multicast_list(struct net_device *dev)
 			control.s.cam_mode = 1;
 
 		gmx_cfg.u64 =
-		    cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
+			cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
 		cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface),
 			       gmx_cfg.u64 & ~1ull);
 
 		cvmx_write_csr(CVMX_GMXX_RXX_ADR_CTL(index, interface),
 			       control.u64);
 		if (dev->flags & IFF_PROMISC)
-			cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN
-				       (index, interface), 0);
+			cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN(index, interface), 0);
 		else
-			cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN
-				       (index, interface), 1);
+			cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN(index, interface), 1);
 
 		cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface),
 			       gmx_cfg.u64);
@@ -360,9 +362,8 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
 	union cvmx_gmxx_prtx_cfg gmx_cfg;
 	int interface = INTERFACE(priv->port);
 
-	if ((interface < 2) &&
-	    (cvmx_helper_interface_get_mode(interface) !=
-		CVMX_HELPER_INTERFACE_MODE_SPI)) {
+	if (interface < 2 && cvmx_helper_interface_get_mode(interface) !=
+				CVMX_HELPER_INTERFACE_MODE_SPI) {
 		int i;
 		const u8 *ptr = dev->dev_addr;
 		u64 mac = 0;
@@ -372,7 +373,7 @@ static int cvm_oct_set_mac_filter(struct net_device *dev)
 			mac = (mac << 8) | (u64)ptr[i];
 
 		gmx_cfg.u64 =
-		    cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
+			cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
 		cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface),
 			       gmx_cfg.u64 & ~1ull);
 
@@ -533,96 +534,96 @@ static int cvm_oct_xaui_open(struct net_device *dev)
 }
 
 static const struct net_device_ops cvm_oct_npi_netdev_ops = {
-	.ndo_init		= cvm_oct_common_init,
-	.ndo_uninit		= cvm_oct_common_uninit,
-	.ndo_start_xmit		= cvm_oct_xmit,
-	.ndo_set_rx_mode	= cvm_oct_common_set_multicast_list,
-	.ndo_set_mac_address	= cvm_oct_common_set_mac_address,
-	.ndo_eth_ioctl		= cvm_oct_ioctl,
-	.ndo_change_mtu		= cvm_oct_common_change_mtu,
-	.ndo_get_stats		= cvm_oct_common_get_stats,
+	.ndo_init = cvm_oct_common_init,
+	.ndo_uninit = cvm_oct_common_uninit,
+	.ndo_start_xmit = cvm_oct_xmit,
+	.ndo_set_rx_mode = cvm_oct_common_set_multicast_list,
+	.ndo_set_mac_address = cvm_oct_common_set_mac_address,
+	.ndo_eth_ioctl = cvm_oct_ioctl,
+	.ndo_change_mtu = cvm_oct_common_change_mtu,
+	.ndo_get_stats = cvm_oct_common_get_stats,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= cvm_oct_poll_controller,
+	.ndo_poll_controller = cvm_oct_poll_controller,
 #endif
 };
 
 static const struct net_device_ops cvm_oct_xaui_netdev_ops = {
-	.ndo_init		= cvm_oct_common_init,
-	.ndo_uninit		= cvm_oct_common_uninit,
-	.ndo_open		= cvm_oct_xaui_open,
-	.ndo_stop		= cvm_oct_common_stop,
-	.ndo_start_xmit		= cvm_oct_xmit,
-	.ndo_set_rx_mode	= cvm_oct_common_set_multicast_list,
-	.ndo_set_mac_address	= cvm_oct_common_set_mac_address,
-	.ndo_eth_ioctl		= cvm_oct_ioctl,
-	.ndo_change_mtu		= cvm_oct_common_change_mtu,
-	.ndo_get_stats		= cvm_oct_common_get_stats,
+	.ndo_init = cvm_oct_common_init,
+	.ndo_uninit = cvm_oct_common_uninit,
+	.ndo_open = cvm_oct_xaui_open,
+	.ndo_stop = cvm_oct_common_stop,
+	.ndo_start_xmit = cvm_oct_xmit,
+	.ndo_set_rx_mode = cvm_oct_common_set_multicast_list,
+	.ndo_set_mac_address = cvm_oct_common_set_mac_address,
+	.ndo_eth_ioctl = cvm_oct_ioctl,
+	.ndo_change_mtu = cvm_oct_common_change_mtu,
+	.ndo_get_stats = cvm_oct_common_get_stats,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= cvm_oct_poll_controller,
+	.ndo_poll_controller = cvm_oct_poll_controller,
 #endif
 };
 
 static const struct net_device_ops cvm_oct_sgmii_netdev_ops = {
-	.ndo_init		= cvm_oct_sgmii_init,
-	.ndo_uninit		= cvm_oct_common_uninit,
-	.ndo_open		= cvm_oct_sgmii_open,
-	.ndo_stop		= cvm_oct_common_stop,
-	.ndo_start_xmit		= cvm_oct_xmit,
-	.ndo_set_rx_mode	= cvm_oct_common_set_multicast_list,
-	.ndo_set_mac_address	= cvm_oct_common_set_mac_address,
-	.ndo_eth_ioctl		= cvm_oct_ioctl,
-	.ndo_change_mtu		= cvm_oct_common_change_mtu,
-	.ndo_get_stats		= cvm_oct_common_get_stats,
+	.ndo_init = cvm_oct_sgmii_init,
+	.ndo_uninit = cvm_oct_common_uninit,
+	.ndo_open = cvm_oct_sgmii_open,
+	.ndo_stop = cvm_oct_common_stop,
+	.ndo_start_xmit = cvm_oct_xmit,
+	.ndo_set_rx_mode = cvm_oct_common_set_multicast_list,
+	.ndo_set_mac_address = cvm_oct_common_set_mac_address,
+	.ndo_eth_ioctl = cvm_oct_ioctl,
+	.ndo_change_mtu = cvm_oct_common_change_mtu,
+	.ndo_get_stats = cvm_oct_common_get_stats,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= cvm_oct_poll_controller,
+	.ndo_poll_controller = cvm_oct_poll_controller,
 #endif
 };
 
 static const struct net_device_ops cvm_oct_spi_netdev_ops = {
-	.ndo_init		= cvm_oct_spi_init,
-	.ndo_uninit		= cvm_oct_spi_uninit,
-	.ndo_start_xmit		= cvm_oct_xmit,
-	.ndo_set_rx_mode	= cvm_oct_common_set_multicast_list,
-	.ndo_set_mac_address	= cvm_oct_common_set_mac_address,
-	.ndo_eth_ioctl		= cvm_oct_ioctl,
-	.ndo_change_mtu		= cvm_oct_common_change_mtu,
-	.ndo_get_stats		= cvm_oct_common_get_stats,
+	.ndo_init = cvm_oct_spi_init,
+	.ndo_uninit = cvm_oct_spi_uninit,
+	.ndo_start_xmit = cvm_oct_xmit,
+	.ndo_set_rx_mode = cvm_oct_common_set_multicast_list,
+	.ndo_set_mac_address = cvm_oct_common_set_mac_address,
+	.ndo_eth_ioctl = cvm_oct_ioctl,
+	.ndo_change_mtu = cvm_oct_common_change_mtu,
+	.ndo_get_stats = cvm_oct_common_get_stats,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= cvm_oct_poll_controller,
+	.ndo_poll_controller = cvm_oct_poll_controller,
 #endif
 };
 
 static const struct net_device_ops cvm_oct_rgmii_netdev_ops = {
-	.ndo_init		= cvm_oct_common_init,
-	.ndo_uninit		= cvm_oct_common_uninit,
-	.ndo_open		= cvm_oct_rgmii_open,
-	.ndo_stop		= cvm_oct_common_stop,
-	.ndo_start_xmit		= cvm_oct_xmit,
-	.ndo_set_rx_mode	= cvm_oct_common_set_multicast_list,
-	.ndo_set_mac_address	= cvm_oct_common_set_mac_address,
-	.ndo_eth_ioctl		= cvm_oct_ioctl,
-	.ndo_change_mtu		= cvm_oct_common_change_mtu,
-	.ndo_get_stats		= cvm_oct_common_get_stats,
+	.ndo_init = cvm_oct_common_init,
+	.ndo_uninit = cvm_oct_common_uninit,
+	.ndo_open = cvm_oct_rgmii_open,
+	.ndo_stop = cvm_oct_common_stop,
+	.ndo_start_xmit = cvm_oct_xmit,
+	.ndo_set_rx_mode = cvm_oct_common_set_multicast_list,
+	.ndo_set_mac_address = cvm_oct_common_set_mac_address,
+	.ndo_eth_ioctl = cvm_oct_ioctl,
+	.ndo_change_mtu = cvm_oct_common_change_mtu,
+	.ndo_get_stats = cvm_oct_common_get_stats,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= cvm_oct_poll_controller,
+	.ndo_poll_controller = cvm_oct_poll_controller,
 #endif
 };
 
 static const struct net_device_ops cvm_oct_pow_netdev_ops = {
-	.ndo_init		= cvm_oct_common_init,
-	.ndo_start_xmit		= cvm_oct_xmit_pow,
-	.ndo_set_rx_mode	= cvm_oct_common_set_multicast_list,
-	.ndo_set_mac_address	= cvm_oct_common_set_mac_address,
-	.ndo_eth_ioctl		= cvm_oct_ioctl,
-	.ndo_change_mtu		= cvm_oct_common_change_mtu,
-	.ndo_get_stats		= cvm_oct_common_get_stats,
+	.ndo_init = cvm_oct_common_init,
+	.ndo_start_xmit = cvm_oct_xmit_pow,
+	.ndo_set_rx_mode = cvm_oct_common_set_multicast_list,
+	.ndo_set_mac_address = cvm_oct_common_set_mac_address,
+	.ndo_eth_ioctl = cvm_oct_ioctl,
+	.ndo_change_mtu = cvm_oct_common_change_mtu,
+	.ndo_get_stats = cvm_oct_common_get_stats,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= cvm_oct_poll_controller,
+	.ndo_poll_controller = cvm_oct_poll_controller,
 #endif
 };
 
-static struct device_node *cvm_oct_of_get_child
-				(const struct device_node *parent, int reg_val)
+static struct device_node *
+cvm_oct_of_get_child(const struct device_node *parent, int reg_val)
 {
 	struct device_node *node;
 	const __be32 *addr;
@@ -737,7 +738,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
 			union cvmx_pip_prt_tagx pip_prt_tagx;
 
 			pip_prt_tagx.u64 =
-			    cvmx_read_csr(CVMX_PIP_PRT_TAGX(port));
+				cvmx_read_csr(CVMX_PIP_PRT_TAGX(port));
 
 			if (receive_group_order) {
 				int tag_mask;
@@ -750,23 +751,23 @@ static int cvm_oct_probe(struct platform_device *pdev)
 					pip_prt_tagx.u64 |= 0x3ull << 44;
 
 				tag_mask = ~((1 << receive_group_order) - 1);
-				pip_prt_tagx.s.grptagbase	= 0;
-				pip_prt_tagx.s.grptagmask	= tag_mask;
-				pip_prt_tagx.s.grptag		= 1;
-				pip_prt_tagx.s.tag_mode		= 0;
-				pip_prt_tagx.s.inc_prt_flag	= 1;
-				pip_prt_tagx.s.ip6_dprt_flag	= 1;
-				pip_prt_tagx.s.ip4_dprt_flag	= 1;
-				pip_prt_tagx.s.ip6_sprt_flag	= 1;
-				pip_prt_tagx.s.ip4_sprt_flag	= 1;
-				pip_prt_tagx.s.ip6_dst_flag	= 1;
-				pip_prt_tagx.s.ip4_dst_flag	= 1;
-				pip_prt_tagx.s.ip6_src_flag	= 1;
-				pip_prt_tagx.s.ip4_src_flag	= 1;
-				pip_prt_tagx.s.grp		= 0;
+				pip_prt_tagx.s.grptagbase = 0;
+				pip_prt_tagx.s.grptagmask = tag_mask;
+				pip_prt_tagx.s.grptag = 1;
+				pip_prt_tagx.s.tag_mode = 0;
+				pip_prt_tagx.s.inc_prt_flag = 1;
+				pip_prt_tagx.s.ip6_dprt_flag = 1;
+				pip_prt_tagx.s.ip4_dprt_flag = 1;
+				pip_prt_tagx.s.ip6_sprt_flag = 1;
+				pip_prt_tagx.s.ip4_sprt_flag = 1;
+				pip_prt_tagx.s.ip6_dst_flag = 1;
+				pip_prt_tagx.s.ip4_dst_flag = 1;
+				pip_prt_tagx.s.ip6_src_flag = 1;
+				pip_prt_tagx.s.ip4_src_flag = 1;
+				pip_prt_tagx.s.grp = 0;
 			} else {
-				pip_prt_tagx.s.grptag	= 0;
-				pip_prt_tagx.s.grp	= pow_receive_group;
+				pip_prt_tagx.s.grptag = 0;
+				pip_prt_tagx.s.grp = pow_receive_group;
 			}
 
 			cvmx_write_csr(CVMX_PIP_PRT_TAGX(port),
@@ -807,23 +808,25 @@ static int cvm_oct_probe(struct platform_device *pdev)
 			dev->max_mtu = OCTEON_MAX_MTU - mtu_overhead;
 
 			if (register_netdev(dev) < 0) {
-				netdev_err(dev, "Failed to register ethernet device for POW\n");
+				netdev_err(dev,
+					   "Failed to register ethernet device for POW\n");
 				free_netdev(dev);
 			} else {
 				cvm_oct_device[CVMX_PIP_NUM_INPUT_PORTS] = dev;
-				netdev_info(dev, "POW send group %d, receive group %d\n",
-					    pow_send_group,
-					    pow_receive_group);
+				netdev_info(dev,
+					    "POW send group %d, receive group %d\n",
+					    pow_send_group, pow_receive_group);
 			}
 		} else {
-			dev_err(&pdev->dev, "Failed to allocate ethernet device for POW\n");
+			dev_err(&pdev->dev,
+				"Failed to allocate ethernet device for POW\n");
 		}
 	}
 
 	num_interfaces = cvmx_helper_get_number_of_interfaces();
 	for (interface = 0; interface < num_interfaces; interface++) {
 		enum cvmx_helper_interface_mode imode =
-		    cvmx_helper_interface_get_mode(interface);
+			cvmx_helper_interface_get_mode(interface);
 		int num_ports = cvmx_helper_ports_on_interface(interface);
 		int port;
 		int port_index;
@@ -834,9 +837,10 @@ static int cvm_oct_probe(struct platform_device *pdev)
 		     port_index++, port++) {
 			struct octeon_ethernet *priv;
 			struct net_device *dev =
-			    alloc_etherdev(sizeof(struct octeon_ethernet));
+				alloc_etherdev(sizeof(struct octeon_ethernet));
 			if (!dev) {
-				dev_err(&pdev->dev, "Failed to allocate ethernet device for port %d\n",
+				dev_err(&pdev->dev,
+					"Failed to allocate ethernet device for port %d\n",
 					port);
 				continue;
 			}
@@ -910,9 +914,11 @@ static int cvm_oct_probe(struct platform_device *pdev)
 				break;
 			}
 
-			if (priv->of_node && of_phy_is_fixed_link(priv->of_node)) {
+			if (priv->of_node &&
+			    of_phy_is_fixed_link(priv->of_node)) {
 				if (of_phy_register_fixed_link(priv->of_node)) {
-					netdev_err(dev, "Failed to register fixed link for interface %d, port %d\n",
+					netdev_err(dev,
+						   "Failed to register fixed link for interface %d, port %d\n",
 						   interface, priv->port);
 					dev->netdev_ops = NULL;
 				}
@@ -921,14 +927,14 @@ static int cvm_oct_probe(struct platform_device *pdev)
 			if (!dev->netdev_ops) {
 				free_netdev(dev);
 			} else if (register_netdev(dev) < 0) {
-				netdev_err(dev, "Failed to register ethernet device for interface %d, port %d\n",
+				netdev_err(dev,
+					   "Failed to register ethernet device for interface %d, port %d\n",
 					   interface, priv->port);
 				free_netdev(dev);
 			} else {
 				cvm_oct_device[priv->port] = dev;
-				fau -=
-				    cvmx_pko_get_num_queues(priv->port) *
-				    sizeof(u32);
+				fau -= cvmx_pko_get_num_queues(priv->port) *
+				       sizeof(u32);
 				schedule_delayed_work(&priv->port_periodic_work,
 						      HZ);
 			}
@@ -1003,8 +1009,8 @@ static void cvm_oct_remove(struct platform_device *pdev)
 	cvmx_ipd_free_ptr();
 
 	/* Free the HW pools */
-	cvm_oct_mem_empty_fpa(pdev, CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE,
-			      num_packet_buffers);
+	cvm_oct_mem_empty_fpa(pdev, CVMX_FPA_PACKET_POOL,
+			      CVMX_FPA_PACKET_POOL_SIZE, num_packet_buffers);
 	cvm_oct_mem_empty_fpa(pdev, CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE,
 			      num_packet_buffers);
 	if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] staging: octeon: fix RGMII condition formatting
       [not found] <20260821041255.1616843-1-tiago.panizio@hotmail.com>
  2026-08-21  4:12 ` [PATCH 1/3] staging: octeon: fix style issues in ethernet.c Tiago Panizio Gottardo
@ 2026-08-21  4:12 ` Tiago Panizio Gottardo
  2026-08-21  6:59   ` Dan Carpenter
  2026-08-21  4:12 ` [PATCH 3/3] staging: octeon: remove unnecessary parentheses Tiago Panizio Gottardo
  2 siblings, 1 reply; 5+ messages in thread
From: Tiago Panizio Gottardo @ 2026-08-21  4:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tiago Panizio Gottardo

Adjust the RGMII open condition formatting to match kernel style while
keeping the existing boolean grouping clear.

No functional changes intended.

Signed-off-by: Tiago Panizio Gottardo <tiago.panizio@hotmail.com>
---
 drivers/staging/octeon/ethernet-rgmii.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c
index 0c4fac31540a..909af74c99bd 100644
--- a/drivers/staging/octeon/ethernet-rgmii.c
+++ b/drivers/staging/octeon/ethernet-rgmii.c
@@ -148,7 +148,7 @@ int cvm_oct_rgmii_open(struct net_device *dev)
 		 */
 		if ((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII &&
 		     priv->port  == 0) ||
-		    (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
+		     priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII) {
 			priv->poll = cvm_oct_check_preamble_errors;
 			cvm_oct_check_preamble_errors(dev);
 		}
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] staging: octeon: remove unnecessary parentheses
       [not found] <20260821041255.1616843-1-tiago.panizio@hotmail.com>
  2026-08-21  4:12 ` [PATCH 1/3] staging: octeon: fix style issues in ethernet.c Tiago Panizio Gottardo
  2026-08-21  4:12 ` [PATCH 2/3] staging: octeon: fix RGMII condition formatting Tiago Panizio Gottardo
@ 2026-08-21  4:12 ` Tiago Panizio Gottardo
  2 siblings, 0 replies; 5+ messages in thread
From: Tiago Panizio Gottardo @ 2026-08-21  4:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tiago Panizio Gottardo

Remove unnecessary parentheses from boolean expressions in the RX and TX
paths.

No functional changes intended.

Signed-off-by: Tiago Panizio Gottardo <tiago.panizio@hotmail.com>
---
 drivers/staging/octeon/ethernet-rx.c |  4 ++--
 drivers/staging/octeon/ethernet-tx.c | 20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 5be43bbf6a1d..e3c773e468b5 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -66,7 +66,7 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
 	else
 		port = work->word1.cn38xx.ipprt;
 
-	if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64))
+	if (work->word2.snoip.err_code == 10 && work->word1.len <= 64)
 		/*
 		 * Ignore length errors on min size packets. Some
 		 * equipment incorrectly pads packets to 64+4FCS
@@ -321,7 +321,7 @@ static int cvm_oct_poll(struct oct_rx_group *rx_group, int budget)
 			}
 			packet_not_copied = 0;
 		}
-		if (likely((port < TOTAL_NUMBER_OF_PORTS) &&
+		if (likely(port < TOTAL_NUMBER_OF_PORTS &&
 			   cvm_oct_device[port])) {
 			struct net_device *dev = cvm_oct_device[port];
 
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index cc20c1e6791f..f13069d6bd2c 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -154,8 +154,8 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * completely remove "qos" in the event neither interface
 	 * supports multiple queues per port.
 	 */
-	if ((CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 > 1) ||
-	    (CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 > 1)) {
+	if (CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 > 1 ||
+	    CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 > 1) {
 		qos = GET_SKBUFF_QOS(skb);
 		if (qos <= 0)
 			qos = 0;
@@ -225,7 +225,7 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * no room to add the padding.  The kernel should always give
 	 * us at least a cache line
 	 */
-	if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
+	if (skb->len < 64 && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
 		union cvmx_gmxx_prtx_cfg gmx_prt_cfg;
 		int interface = INTERFACE(priv->port);
 		int index = INDEX(priv->port);
@@ -360,13 +360,13 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 dont_put_skbuff_in_hw:
 
 	/* Check if we can use the hardware checksumming */
-	if ((skb->protocol == htons(ETH_P_IP)) &&
-	    (ip_hdr(skb)->version == 4) &&
-	    (ip_hdr(skb)->ihl == 5) &&
-	    ((ip_hdr(skb)->frag_off == 0) ||
-	     (ip_hdr(skb)->frag_off == htons(1 << 14))) &&
-	    ((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
-	     (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
+	if (skb->protocol == htons(ETH_P_IP) &&
+	    ip_hdr(skb)->version == 4 &&
+	    ip_hdr(skb)->ihl == 5 &&
+	    (ip_hdr(skb)->frag_off == 0 ||
+	     ip_hdr(skb)->frag_off == htons(1 << 14)) &&
+	    (ip_hdr(skb)->protocol == IPPROTO_TCP ||
+	     ip_hdr(skb)->protocol == IPPROTO_UDP)) {
 		/* Use hardware checksum calc */
 		pko_command.s.ipoffp1 = skb_network_offset(skb) + 1;
 	}
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] staging: octeon: fix style issues in ethernet.c
  2026-08-21  4:12 ` [PATCH 1/3] staging: octeon: fix style issues in ethernet.c Tiago Panizio Gottardo
@ 2026-08-21  6:58   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2026-08-21  6:58 UTC (permalink / raw)
  To: Tiago Panizio Gottardo; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Fri, Aug 21, 2026 at 01:12:53AM -0300, Tiago Panizio Gottardo wrote:
> Fix several coding style issues in ethernet.c, including line wrapping,
> continuation alignment and function declaration formatting.
> 
> No functional changes intended.
> 
> Signed-off-by: Tiago Panizio Gottardo <tiago.panizio@hotmail.com>
> ---

1. This patch does a bunch of things at once.  Do, one thing per patch.
2. Some of things are weird.

>  static void cvm_oct_rx_refill_worker(struct work_struct *work)
>  {
>  	struct octeon_ethernet_platform *plat = container_of(work,
> -		struct octeon_ethernet_platform, rx_refill_work.work);
> +							     struct octeon_ethernet_platform,
> +							     rx_refill_work.work);
>  	/*

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] staging: octeon: fix RGMII condition formatting
  2026-08-21  4:12 ` [PATCH 2/3] staging: octeon: fix RGMII condition formatting Tiago Panizio Gottardo
@ 2026-08-21  6:59   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2026-08-21  6:59 UTC (permalink / raw)
  To: Tiago Panizio Gottardo; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Fri, Aug 21, 2026 at 01:12:54AM -0300, Tiago Panizio Gottardo wrote:
> Adjust the RGMII open condition formatting to match kernel style while
> keeping the existing boolean grouping clear.
> 
> No functional changes intended.
> 
> Signed-off-by: Tiago Panizio Gottardo <tiago.panizio@hotmail.com>
> ---

I disabled this warning for drivers/staging so I'm not sure how
you still see this message.  Same comments apply to patch 3 as
well.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-21  6:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260821041255.1616843-1-tiago.panizio@hotmail.com>
2026-08-21  4:12 ` [PATCH 1/3] staging: octeon: fix style issues in ethernet.c Tiago Panizio Gottardo
2026-08-21  6:58   ` Dan Carpenter
2026-08-21  4:12 ` [PATCH 2/3] staging: octeon: fix RGMII condition formatting Tiago Panizio Gottardo
2026-08-21  6:59   ` Dan Carpenter
2026-08-21  4:12 ` [PATCH 3/3] staging: octeon: remove unnecessary parentheses Tiago Panizio Gottardo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.