linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 02/29] can: slcan: convert comments to network style comments
Date: Wed, 20 Jul 2022 10:10:07 +0200	[thread overview]
Message-ID: <20220720081034.3277385-3-mkl@pengutronix.de> (raw)
In-Reply-To: <20220720081034.3277385-1-mkl@pengutronix.de>

Convert all comments to network subsystem style comments.

Link: https://lore.kernel.org/all/20220704125954.1587880-2-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/slcan/slcan-core.c | 55 +++++++++++++-----------------
 1 file changed, 24 insertions(+), 31 deletions(-)

diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c
index 92bdd49996d1..2d3bf15061a7 100644
--- a/drivers/net/can/slcan/slcan-core.c
+++ b/drivers/net/can/slcan/slcan-core.c
@@ -67,8 +67,9 @@ MODULE_AUTHOR("Oliver Hartkopp <socketcan@hartkopp.net>");
 #define SLCAN_MAGIC 0x53CA
 
 static int maxdev = 10;		/* MAX number of SLCAN channels;
-				   This can be overridden with
-				   insmod slcan.ko maxdev=nnn	*/
+				 * This can be overridden with
+				 * insmod slcan.ko maxdev=nnn
+				 */
 module_param(maxdev, int, 0);
 MODULE_PARM_DESC(maxdev, "Maximum number of slcan interfaces");
 
@@ -139,12 +140,11 @@ int slcan_enable_err_rst_on_open(struct net_device *ndev, bool on)
 	return 0;
 }
 
- /************************************************************************
-  *			SLCAN ENCAPSULATION FORMAT			 *
-  ************************************************************************/
+/*************************************************************************
+ *			SLCAN ENCAPSULATION FORMAT			 *
+ *************************************************************************/
 
-/*
- * A CAN frame has a can_id (11 bit standard frame format OR 29 bit extended
+/* A CAN frame has a can_id (11 bit standard frame format OR 29 bit extended
  * frame format) a data length code (len) which can be from 0 to 8
  * and up to <len> data bytes as payload.
  * Additionally a CAN frame may become a remote transmission frame if the
@@ -174,9 +174,9 @@ int slcan_enable_err_rst_on_open(struct net_device *ndev, bool on)
  *
  */
 
- /************************************************************************
-  *			STANDARD SLCAN DECAPSULATION			 *
-  ************************************************************************/
+/*************************************************************************
+ *			STANDARD SLCAN DECAPSULATION			 *
+ *************************************************************************/
 
 /* Send one completely decapsulated can_frame to the network layer */
 static void slc_bump_frame(struct slcan *sl)
@@ -486,9 +486,9 @@ static void slcan_unesc(struct slcan *sl, unsigned char s)
 	}
 }
 
- /************************************************************************
-  *			STANDARD SLCAN ENCAPSULATION			 *
-  ************************************************************************/
+/*************************************************************************
+ *			STANDARD SLCAN ENCAPSULATION			 *
+ *************************************************************************/
 
 /* Encapsulate one can_frame and stuff into a TTY queue. */
 static void slc_encaps(struct slcan *sl, struct can_frame *cf)
@@ -575,7 +575,8 @@ static void slcan_transmit(struct work_struct *work)
 		}
 
 		/* Now serial buffer is almost free & we can start
-		 * transmission of another packet */
+		 * transmission of another packet
+		 */
 		sl->dev->stats.tx_packets++;
 		clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
 		spin_unlock_bh(&sl->lock);
@@ -589,8 +590,7 @@ static void slcan_transmit(struct work_struct *work)
 	spin_unlock_bh(&sl->lock);
 }
 
-/*
- * Called by the driver when there's room for more data.
+/* Called by the driver when there's room for more data.
  * Schedule the transmit.
  */
 static void slcan_write_wakeup(struct tty_struct *tty)
@@ -632,7 +632,6 @@ static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev)
 	return NETDEV_TX_OK;
 }
 
-
 /******************************************
  *   Routines looking at netdevice side.
  ******************************************/
@@ -736,7 +735,6 @@ static int slc_open(struct net_device *dev)
 		/* The CAN framework has already validate the bitrate value,
 		 * so we can avoid to check if `s' has been properly set.
 		 */
-
 		snprintf(cmd, sizeof(cmd), "C\rS%d\r", s);
 		err = slcan_transmit_cmd(sl, cmd);
 		if (err) {
@@ -792,18 +790,16 @@ static const struct net_device_ops slc_netdev_ops = {
 };
 
 /******************************************
-  Routines looking at TTY side.
+ *  Routines looking at TTY side.
  ******************************************/
 
-/*
- * Handle the 'receiver data ready' interrupt.
+/* Handle the 'receiver data ready' interrupt.
  * This function is called by the 'tty_io' module in the kernel when
  * a block of SLCAN data has been received, which can now be decapsulated
  * and sent on to some IP layer for further processing. This will not
  * be re-entered while running but other ldisc functions may be called
  * in parallel
  */
-
 static void slcan_receive_buf(struct tty_struct *tty,
 			      const unsigned char *cp, const char *fp,
 			      int count)
@@ -890,8 +886,7 @@ static struct slcan *slc_alloc(void)
 	return sl;
 }
 
-/*
- * Open the high-level part of the SLCAN channel.
+/* Open the high-level part of the SLCAN channel.
  * This function is called by the TTY module when the
  * SLCAN line discipline is called for.  Because we are
  * sure the tty line exists, we only have to link it to
@@ -899,7 +894,6 @@ static struct slcan *slc_alloc(void)
  *
  * Called in process context serialized from other ldisc calls.
  */
-
 static int slcan_open(struct tty_struct *tty)
 {
 	struct slcan *sl;
@@ -912,8 +906,8 @@ static int slcan_open(struct tty_struct *tty)
 		return -EOPNOTSUPP;
 
 	/* RTnetlink lock is misused here to serialize concurrent
-	   opens of slcan channels. There are better ways, but it is
-	   the simplest one.
+	 * opens of slcan channels. There are better ways, but it is
+	 * the simplest one.
 	 */
 	rtnl_lock();
 
@@ -974,14 +968,12 @@ static int slcan_open(struct tty_struct *tty)
 	return err;
 }
 
-/*
- * Close down a SLCAN channel.
+/* Close down a SLCAN channel.
  * This means flushing out any pending queues, and then returning. This
  * call is serialized against other ldisc functions.
  *
  * We also use this method for a hangup event.
  */
-
 static void slcan_close(struct tty_struct *tty)
 {
 	struct slcan *sl = (struct slcan *) tty->disc_data;
@@ -1104,7 +1096,8 @@ static void __exit slcan_exit(void)
 	} while (busy && time_before(jiffies, timeout));
 
 	/* FIXME: hangup is async so we should wait when doing this second
-	   phase */
+	 * phase
+	 */
 
 	for (i = 0; i < maxdev; i++) {
 		dev = slcan_devs[i];
-- 
2.35.1



  parent reply	other threads:[~2022-07-20  8:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20  8:10 [PATCH net-next 0/29] pull-request: can-next 2022-07-20 Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 01/29] can: slcan: use scnprintf() as a hardening measure Marc Kleine-Budde
2022-07-20  9:30   ` patchwork-bot+netdevbpf
2022-07-20  8:10 ` Marc Kleine-Budde [this message]
2022-07-20  8:10 ` [PATCH net-next 03/29] can: slcan: slcan_init() convert printk(LEVEL ...) to pr_level() Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 04/29] can: slcan: fix whitespace issues Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 05/29] can: slcan: convert comparison to NULL into !val Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 06/29] can: slcan: clean up if/else Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 07/29] dt-bindings: can: sja1000: Convert to json-schema Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 08/29] dt-bindings: can: nxp,sja1000: Document RZ/N1{D,S} support Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 09/29] can: sja1000: Add Quirk for RZ/N1 SJA1000 CAN controller Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 10/29] can: sja1000: Use device_get_match_data to get device data Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 11/29] can: sja1000: Change the return type as void for SoC specific init Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 12/29] can: slcan: do not sleep with a spin lock held Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 13/29] can: c_can: remove wrong comment Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 14/29] can: ctucanfd: Update CTU CAN FD IP core registers to match version 3.x Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 15/29] can: peak_usb: pcan_dump_mem(): mark input prompt and data pointer as const Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 16/29] can: peak_usb: correction of an initially misnamed field name Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 17/29] can: peak_usb: include support for a new MCU Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 18/29] can: pch_can: do not report txerr and rxerr during bus-off Marc Kleine-Budde
2022-07-21 15:27   ` Nathan Chancellor
2022-07-21 15:47     ` Marc Kleine-Budde
2022-07-21 16:11       ` Vincent MAILHOL
2022-07-21 16:20         ` Nathan Chancellor
2022-07-21 16:51           ` Jakub Kicinski
2022-07-21 16:00     ` [PATCH] can: pch_can: initialize errc before using it Vincent Mailhol
2022-07-21 16:02       ` Nathan Chancellor
2022-07-20  8:10 ` [PATCH net-next 19/29] can: rcar_can: do not report txerr and rxerr during bus-off Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 20/29] can: sja1000: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 21/29] can: slcan: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 22/29] can: hi311x: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 23/29] can: sun4i_can: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 24/29] can: kvaser_usb_hydra: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 25/29] can: kvaser_usb_leaf: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 26/29] can: usb_8dev: " Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 27/29] can: error: specify the values of data[5..7] of CAN error frames Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 28/29] can: add CAN_ERR_CNT flag to notify availability of error counter Marc Kleine-Budde
2022-07-20  8:10 ` [PATCH net-next 29/29] can: error: add definitions for the different CAN error thresholds Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720081034.3277385-3-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).