linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO.
@ 2021-05-03 17:03 Jordan Vaughn
  2021-05-03 17:34 ` Greg KH
  2021-05-04  8:17 ` Dan Carpenter
  0 siblings, 2 replies; 4+ messages in thread
From: Jordan Vaughn @ 2021-05-03 17:03 UTC (permalink / raw)
  To: gregkh, ganesanr; +Cc: linux-staging, Jordan Vaughn, jchandra

Netlogic: xlr_net: Fix styling problems with comments 

Signed-off-by: Jordan Vaughn <jordvaughn1@gmail.com>
---
 drivers/staging/netlogic/xlr_net.c | 67 +++++++++++++++---------------
 drivers/staging/netlogic/xlr_net.h |  3 +-
 2 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 69ea61faf8fa..c1539b6b75b8 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -15,20 +15,19 @@
 #include <linux/jiffies.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
-
 #include <asm/mipsregs.h>
-/*
+
+/**
  * fmn.h - For FMN credit configuration and registering fmn_handler.
  * FMN is communication mechanism that allows processing agents within
  * XLR/XLS to communicate each other.
  */
 #include <asm/netlogic/xlr/fmn.h>
-
 #include "platform_net.h"
 #include "xlr_net.h"
 
-/*
- * The readl/writel implementation byteswaps on XLR/XLS, so
+/**
+ * xlr_nae_wreg() - The readl/writel implementation byteswaps on XLR/XLS, so
  * we need to use __raw_ IO to read the NAE registers
  * because they are in the big-endian MMIO area on the SoC.
  */
@@ -140,8 +139,8 @@ static struct phy_device *xlr_get_phydev(struct xlr_net_priv *priv)
 	return mdiobus_get_phy(priv->mii_bus, priv->phy_addr);
 }
 
-/*
- * Ethtool operation
+/**
+ * xlr_get_link_ksettings() - Ethtool operation
  */
 static int xlr_get_link_ksettings(struct net_device *ndev,
 				  struct ethtool_link_ksettings *ecmd)
@@ -173,8 +172,8 @@ static const struct ethtool_ops xlr_ethtool_ops = {
 	.set_link_ksettings = xlr_set_link_ksettings,
 };
 
-/*
- * Net operations
+/**
+ * xlr_net_fill_rx_ring() -  Net operations
  */
 static int xlr_net_fill_rx_ring(struct net_device *ndev)
 {
@@ -372,10 +371,10 @@ static const struct net_device_ops xlr_netdev_ops = {
 	.ndo_get_stats64 = xlr_stats,
 };
 
-/*
- * Gmac init
+/**
+ * xlr_config_spill() -  Gmac init
  */
-static void *xlr_config_spill(struct xlr_net_priv *priv, int reg_start_0,
+static void xlr_config_spill(struct xlr_net_priv *priv, int reg_start_0,
 			      int reg_start_1, int reg_size, int size)
 {
 	void *spill;
@@ -400,8 +399,8 @@ static void *xlr_config_spill(struct xlr_net_priv *priv, int reg_start_0,
 	return spill;
 }
 
-/*
- * Configure the 6 FIFO's that are used by the network accelarator to
+/**
+ * xlr_config_fifo_spill_area() - Configure the 6 FIFO's that are used by the network accelarator to
  * communicate with the rest of the XLx device. 4 of the FIFO's are for
  * packets from NA --> cpu (called Class FIFO's) and 2 are for feeding
  * the NA with free descriptors.
@@ -440,8 +439,8 @@ static void xlr_config_fifo_spill_area(struct xlr_net_priv *priv)
 					       MAX_CLASS_3_SPILL * sizeof(u64));
 }
 
-/*
- * Configure PDE to Round-Robin distribution of packets to the
+/**
+ * xlr_config_pde() -  Configures PDE to Round-Robin distribution of packets to the
  * available cpu
  */
 static void xlr_config_pde(struct xlr_net_priv *priv)
@@ -470,8 +469,8 @@ static void xlr_config_pde(struct xlr_net_priv *priv)
 		     ((bkt_map >> 32) & 0xffffffff));
 }
 
-/*
- * Setup the Message ring credits, bucket size and other
+/**
+ * xlr_config_common() - Setup the Message ring credits, bucket size and other
  * common configuration
  */
 static int xlr_config_common(struct xlr_net_priv *priv)
@@ -544,7 +543,7 @@ static void xlr_config_translate_table(struct xlr_net_priv *priv)
 	for (i = 0; i < 64; i++) {
 		/*
 		 * On use_bkt set the b0, b1 are used, else
-		 * the 4 classes are used, here implemented
+		 * the 4 classes are used, implemented here with
 		 * a logic to distribute the packets to the
 		 * buckets equally or based on the class
 		 */
@@ -575,8 +574,10 @@ static void xlr_config_parser(struct xlr_net_priv *priv)
 	xlr_nae_wreg(priv->base_addr, R_PARSERCONFIGREG,
 		     ((0x7f << 8) | (1 << 1)));
 
-	/* configure the parser : L2 Type is configured in the bootloader */
-	/* extract IP: src, dest protocol */
+	/*
+	 * configure the parser : L2 Type is configured in the bootloader
+	 * extract IP: src, dest protocol
+	 */
 	xlr_nae_wreg(priv->base_addr, R_L3CTABLE,
 		     (9 << 20) | (1 << 19) | (1 << 18) | (0x01 << 16) |
 		     (0x0800 << 0));
@@ -599,7 +600,7 @@ static int xlr_phy_write(u32 *base_addr, int phy_addr, int regnum, u16 val)
 	unsigned long timeout, stoptime, checktime;
 	int timedout;
 
-	/* 100ms timeout*/
+
 	timeout = msecs_to_jiffies(100);
 	stoptime = jiffies + timeout;
 	timedout = 0;
@@ -629,7 +630,7 @@ static int xlr_phy_read(u32 *base_addr, int phy_addr, int regnum)
 	unsigned long timeout, stoptime, checktime;
 	int timedout;
 
-	/* 100ms timeout*/
+
 	timeout = msecs_to_jiffies(100);
 	stoptime = jiffies + timeout;
 	timedout = 0;
@@ -683,11 +684,11 @@ static int xlr_mii_read(struct mii_bus *bus, int phy_addr, int regnum)
 	return ret;
 }
 
-/*
- * XLR ports are RGMII. XLS ports are SGMII mostly except the port0,
+/**
+ * xlr_sgmii_init() - XLR ports are RGMII. XLS ports are SGMII mostly except the port0,
  * which can be configured either SGMII or RGMII, considered SGMII
  * by default, if board setup to RGMII the port_type need to set
- * accordingly.Serdes and PCS layer need to configured for SGMII
+ * accordingly.Serdes and PCS layer need to be configured for SGMII
  */
 static void xlr_sgmii_init(struct xlr_net_priv *priv)
 {
@@ -886,8 +887,10 @@ static void xlr_port_enable(struct xlr_net_priv *priv)
 
 static void xlr_port_disable(struct xlr_net_priv *priv)
 {
-	/* Setup MAC_CONFIG reg */
-	/* Rx Tx disable*/
+	/*
+	 * Setup MAC_CONFIG reg
+	 * Rx Tx disable
+	 */
 	xlr_reg_update(priv->base_addr, R_MAC_CONFIG_1,
 		       ((1 << O_MAC_CONFIG_1__rxen) |
 			(1 << O_MAC_CONFIG_1__txen) |
@@ -904,8 +907,8 @@ static void xlr_port_disable(struct xlr_net_priv *priv)
 		       1 << O_RX_CONTROL__RXENABLE, 0);
 }
 
-/*
- * Initialization of gmac
+/**
+ * xlr_gmac_init() - Initialize gmac
  */
 static int xlr_gmac_init(struct xlr_net_priv *priv,
 			 struct platform_device *pdev)
@@ -951,9 +954,7 @@ static int xlr_net_probe(struct platform_device *pdev)
 	int err, port;
 
 	pr_info("XLR/XLS Ethernet Driver controller %d\n", pdev->id);
-	/*
-	 * Allocate our adapter data structure and attach it to the device.
-	 */
+	 /* Allocate our adapter data structure and attach it to the device.*/
 	adapter = devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
 	if (!adapter)
 		return -ENOMEM;
diff --git a/drivers/staging/netlogic/xlr_net.h b/drivers/staging/netlogic/xlr_net.h
index 8365b744f9b3..c88e465b0e06 100644
--- a/drivers/staging/netlogic/xlr_net.h
+++ b/drivers/staging/netlogic/xlr_net.h
@@ -971,7 +971,8 @@
 		MAC_PREPAD + MAC_SKB_BACK_PTR_SIZE + SMP_CACHE_BYTES)
 #define MAC_CRC_LEN                     4
 #define MAX_NUM_MSGRNG_STN_CC           128
-#define MAX_MSG_SND_ATTEMPTS		100	/* 13 stns x 4 entry msg/stn +
+#define MAX_MSG_SND_ATTEMPTS		100	/*
+						 * 13 stns x 4 entry msg/stn +
 						 * headroom
 						 */
 
-- 
2.30.2


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

* Re: [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO.
  2021-05-03 17:03 [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO Jordan Vaughn
@ 2021-05-03 17:34 ` Greg KH
  2021-05-04  8:17 ` Dan Carpenter
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-05-03 17:34 UTC (permalink / raw)
  To: Jordan Vaughn; +Cc: ganesanr, linux-staging, Jordan Vaughn, jchandra

On Mon, May 03, 2021 at 05:03:53PM +0000, Jordan Vaughn wrote:
> Netlogic: xlr_net: Fix styling problems with comments 
> 
> Signed-off-by: Jordan Vaughn <jordvaughn1@gmail.com>
> ---
>  drivers/staging/netlogic/xlr_net.c | 67 +++++++++++++++---------------
>  drivers/staging/netlogic/xlr_net.h |  3 +-
>  2 files changed, 36 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
> index 69ea61faf8fa..c1539b6b75b8 100644
> --- a/drivers/staging/netlogic/xlr_net.c
> +++ b/drivers/staging/netlogic/xlr_net.c
> @@ -15,20 +15,19 @@
>  #include <linux/jiffies.h>
>  #include <linux/interrupt.h>
>  #include <linux/platform_device.h>
> -

This was not a comment change :(

And please write a better changelog.

>  #include <asm/mipsregs.h>
> -/*
> +
> +/**

That's a kernel-doc format marker, why did you do that?

thanks,

greg k-h

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

* Re: [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO.
  2021-05-03 17:03 [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO Jordan Vaughn
  2021-05-03 17:34 ` Greg KH
@ 2021-05-04  8:17 ` Dan Carpenter
  2021-05-04  8:29   ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2021-05-04  8:17 UTC (permalink / raw)
  To: Jordan Vaughn; +Cc: gregkh, ganesanr, linux-staging, Jordan Vaughn, jchandra

The subject doesn't make sense.

> -/*
> - * Configure the 6 FIFO's that are used by the network accelarator to
> +/**
> + * xlr_config_fifo_spill_area() - Configure the 6 FIFO's that are used by the network accelarator to

This comment is way too long now.  For comments, we want to be within
the 80 character limit.


>   * communicate with the rest of the XLx device. 4 of the FIFO's are for
>   * packets from NA --> cpu (called Class FIFO's) and 2 are for feeding
>   * the NA with free descriptors.
> @@ -440,8 +439,8 @@ static void xlr_config_fifo_spill_area(struct xlr_net_priv *priv)

[ snip ]

> @@ -599,7 +600,7 @@ static int xlr_phy_write(u32 *base_addr, int phy_addr, int regnum, u16 val)
>  	unsigned long timeout, stoptime, checktime;
>  	int timedout;
>  
> -	/* 100ms timeout*/
> +
>  	timeout = msecs_to_jiffies(100);

This patch introduces a double blank line checkpatch warning.

>  	stoptime = jiffies + timeout;
>  	timedout = 0;
> @@ -629,7 +630,7 @@ static int xlr_phy_read(u32 *base_addr, int phy_addr, int regnum)
>  	unsigned long timeout, stoptime, checktime;
>  	int timedout;
>  
> -	/* 100ms timeout*/
> +
>  	timeout = msecs_to_jiffies(100);

Same.

>  	stoptime = jiffies + timeout;
>  	timedout = 0;

[ snip ]

> @@ -951,9 +954,7 @@ static int xlr_net_probe(struct platform_device *pdev)
>  	int err, port;
>  
>  	pr_info("XLR/XLS Ethernet Driver controller %d\n", pdev->id);
> -	/*
> -	 * Allocate our adapter data structure and attach it to the device.
> -	 */
> +	 /* Allocate our adapter data structure and attach it to the device.*/

There needs to be a space before the "*/" closing.

>  	adapter = devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
>  	if (!adapter)
>  		return -ENOMEM;

regards,
dan carpenter


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

* Re: [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO.
  2021-05-04  8:17 ` Dan Carpenter
@ 2021-05-04  8:29   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-05-04  8:29 UTC (permalink / raw)
  To: Jordan Vaughn; +Cc: gregkh, ganesanr, linux-staging, Jordan Vaughn, jchandra

On Tue, May 04, 2021 at 11:17:58AM +0300, Dan Carpenter wrote:
> The subject doesn't make sense.

That subject does make sense, it's just that my email client wrapped it
so that I didn't see the last few words.  It needs to be shorter.

regards,
dan carpenter


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

end of thread, other threads:[~2021-05-04  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 17:03 [PATCH] netlogic: This patch formats existing comments to Linux standards found in TODO Jordan Vaughn
2021-05-03 17:34 ` Greg KH
2021-05-04  8:17 ` Dan Carpenter
2021-05-04  8:29   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).