All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Wolfram Sang <wsa@the-dreams.de>, driverdev-devel@linuxdriverproject.org
Subject: [PATCH 09/15] staging: ks7010: clean up SDIO source comments
Date: Tue, 18 Apr 2017 10:35:37 +1000	[thread overview]
Message-ID: <1492475743-25189-10-git-send-email-me@tobin.cc> (raw)
In-Reply-To: <1492475743-25189-1-git-send-email-me@tobin.cc>

SDIO code currently has a number of unneeded comments. Following
kernel coding style we do not need extraneous comments, especially on
code where it is clear what is being done. Spelling typos can be
fixed.

Remove unnecessary comments, fix typos in comments.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
 drivers/staging/ks7010/ks7010_sdio.c | 32 +++++---------------------------
 1 file changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index e3e2989..87d5519 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -32,8 +32,6 @@ static const struct sdio_device_id ks7010_sdio_ids[] = {
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-/* macro */
-
 #define inc_txqhead(priv) \
 	(priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
 #define inc_txqtail(priv) \
@@ -247,7 +245,6 @@ static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
 	}
 
 	if ((TX_DEVICE_BUFF_SIZE - 1) <= cnt_txqbody(priv)) {
-		/* in case of buffer overflow */
 		DPRINTK(1, "tx buffer overflow\n");
 		ret = -EOVERFLOW;
 		goto err_complete;
@@ -389,7 +386,6 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
 
 	/* receive data */
 	if (cnt_rxqbody(priv) >= (RX_DEVICE_BUFF_SIZE - 1)) {
-		/* in case of buffer overflow */
 		DPRINTK(1, "rx buffer overflow\n");
 		return;
 	}
@@ -453,14 +449,14 @@ static void ks7010_rw_function(struct work_struct *work)
 
 	DPRINTK(4, "\n");
 
-	/* wiat after DOZE */
+	/* wait after DOZE */
 	if (time_after(priv->last_doze + ((30 * HZ) / 1000), jiffies)) {
 		DPRINTK(4, "wait after DOZE\n");
 		queue_delayed_work(priv->wq, &priv->rw_dwork, 1);
 		return;
 	}
 
-	/* wiat after WAKEUP */
+	/* wait after WAKEUP */
 	while (time_after(priv->last_wakeup + ((30 * HZ) / 1000), jiffies)) {
 		DPRINTK(4, "wait after WAKEUP\n");
 		dev_info(&priv->ks_sdio_card->func->dev,
@@ -588,15 +584,12 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 
 static int trx_device_init(struct ks_wlan_private *priv)
 {
-	/* initialize values (tx) */
 	priv->tx_dev.qhead = 0;
 	priv->tx_dev.qtail = 0;
 
-	/* initialize values (rx) */
 	priv->rx_dev.qhead = 0;
 	priv->rx_dev.qtail = 0;
 
-	/* initialize spinLock (tx,rx) */
 	spin_lock_init(&priv->tx_dev.tx_dev_lock);
 	spin_lock_init(&priv->rx_dev.rx_dev_lock);
 
@@ -612,7 +605,7 @@ static void trx_device_exit(struct ks_wlan_private *priv)
 	/* tx buffer clear */
 	while (cnt_txqbody(priv) > 0) {
 		sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
-		kfree(sp->sendp);	/* allocated memory free */
+		kfree(sp->sendp);
 		if (sp->complete_handler)	/* TX Complete */
 			(*sp->complete_handler)(priv, sp->skb);
 		inc_txqhead(priv);
@@ -686,7 +679,6 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 	unsigned int length;
 	const struct firmware *fw_entry = NULL;
 
-	/* buffer allocate */
 	rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
 	if (!rom_buf)
 		return -ENOMEM;
@@ -707,7 +699,6 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 
 	length = fw_entry->size;
 
-	/* Load Program */
 	n = 0;
 	do {
 		if (length >= ROM_BUFF_SIZE) {
@@ -721,18 +712,16 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 		if (size == 0)
 			break;
 		memcpy(rom_buf, fw_entry->data + n, size);
-		/* Update write index */
+
 		offset = n;
 		ret = ks7010_sdio_update_index(priv, KS7010_IRAM_ADDRESS + offset);
 		if (ret)
 			goto release_firmware;
 
-		/* Write data */
 		ret = ks7010_sdio_write(priv, DATA_WINDOW, rom_buf, size);
 		if (ret)
 			goto release_firmware;
 
-		/* compare */
 		ret = ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
 		if (ret)
 			goto release_firmware;
@@ -741,7 +730,6 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 
 	} while (size);
 
-	/* Remap request */
 	rw_data = GCR_A_REMAP;
 	ret = ks7010_sdio_write(priv, GCR_A, &rw_data, sizeof(rw_data));
 	if (ret)
@@ -781,7 +769,6 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
 {
 	DPRINTK(5, "\ncard_init_task()\n");
 
-	/* init_waitqueue_head(&priv->confirm_wait); */
 	init_completion(&priv->confirm_wait);
 
 	DPRINTK(5, "init_completion()\n");
@@ -872,27 +859,18 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	priv = NULL;
 	netdev = NULL;
 
-	/* initialize ks_sdio_card */
 	card = kzalloc(sizeof(*card), GFP_KERNEL);
 	if (!card)
 		return -ENOMEM;
 
 	card->func = func;
 
-	/*** Initialize  SDIO ***/
 	sdio_claim_host(func);
 
-	/* bus setting  */
-	/* Issue config request to override clock rate */
-
-	/* function blocksize set */
 	ret = sdio_set_block_size(func, KS7010_IO_BLOCK_SIZE);
 	DPRINTK(5, "multi_block=%d sdio_set_block_size()=%d %d\n",
 		func->card->cccr.multi_block, func->cur_blksize, ret);
 
-	/* Allocate the slot current */
-
-	/* function enable */
 	ret = sdio_enable_func(func);
 	DPRINTK(5, "sdio_enable_func() %d\n", ret);
 	if (ret)
@@ -942,7 +920,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	priv->net_dev = netdev;
 	priv->firmware_version[0] = '\0';
 	priv->version_size = 0;
-	priv->last_doze = jiffies;	/* set current jiffies */
+	priv->last_doze = jiffies;
 	priv->last_wakeup = jiffies;
 	memset(&priv->nstats, 0, sizeof(priv->nstats));
 	memset(&priv->wstats, 0, sizeof(priv->wstats));
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2017-04-18  0:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  0:35 [PATCH 00/15] staging: ks7010: refactor SDIO code Tobin C. Harding
2017-04-18  0:35 ` [PATCH 01/15] staging: ks7010: create reg_status_type enum type Tobin C. Harding
2017-04-18  0:35 ` [PATCH 02/15] staging: ks7010: replace defines with enum types Tobin C. Harding
2017-04-18  0:35 ` [PATCH 03/15] staging: ks7010: fix complete_handler Tobin C. Harding
2017-04-18  0:35 ` [PATCH 04/15] staging: ks7010: clean up SDIO header comments Tobin C. Harding
2017-04-18  0:35 ` [PATCH 05/15] staging: ks7010: rename wakeup work struct Tobin C. Harding
2017-04-18  0:35 ` [PATCH 06/15] staging: ks7010: move tasklet_struct to ks_wlan_private Tobin C. Harding
2017-04-18  0:35 ` [PATCH 07/15] staging: ks7010: move hw info into dev private data Tobin C. Harding
2017-04-18  0:35 ` [PATCH 08/15] staging: ks7010: add struct comment to ks_sdio_card Tobin C. Harding
2017-04-18  0:35 ` Tobin C. Harding [this message]
2017-04-18  0:35 ` [PATCH 10/15] staging: ks7010: remove err_ from non-error path label Tobin C. Harding
2017-04-18  0:35 ` [PATCH 11/15] staging: ks7010: fix checkpatch SPACE_BEFORE_TAB Tobin C. Harding
2017-04-18  0:35 ` [PATCH 12/15] staging: ks7010: fix checkpatch LINE_SPACING Tobin C. Harding
2017-04-18  0:35 ` [PATCH 13/15] staging: ks7010: refactor SDIO read/write helpers Tobin C. Harding
2017-04-18  0:35 ` [PATCH 14/15] staging: ks7010: fix checkpatch SPLIT_STRING Tobin C. Harding
2017-04-18  0:35 ` [PATCH 15/15] staging: ks7010: rename SDIO files Tobin C. Harding
2017-04-18 11:47   ` Greg Kroah-Hartman

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=1492475743-25189-10-git-send-email-me@tobin.cc \
    --to=me@tobin.cc \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=wsa@the-dreams.de \
    /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 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.