public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call
@ 2017-07-31  2:20 Ashish Kalra
  2017-08-01  0:25 ` Joe Perches
  0 siblings, 1 reply; 16+ messages in thread
From: Ashish Kalra @ 2017-07-31  2:20 UTC (permalink / raw)
  To: gregkh, wsa, driverdev-devel, devel, linux-kernel; +Cc: Ashish Kalra

---
 drivers/staging/ks7010/ks7010_sdio.c | 47 +++++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 9b28ee1..274fed8 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -9,7 +9,6 @@
  *   it under the terms of the GNU General Public License version 2 as
  *   published by the Free Software Foundation.
  */
-
 #include <linux/firmware.h>
 #include <linux/mmc/card.h>
 #include <linux/mmc/sdio_func.h>
@@ -32,19 +31,39 @@
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-#define inc_txqhead(priv) \
-	(priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
-#define inc_txqtail(priv) \
-	(priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE)
-#define cnt_txqbody(priv) \
-	(((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE)
-
-#define inc_rxqhead(priv) \
-	(priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE)
-#define inc_rxqtail(priv) \
-	(priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE)
-#define cnt_rxqbody(priv) \
-	(((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE)
+static int inc_txqhead(struct ks_wlan_private *priv)
+{
+	priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
+	return 0;
+}
+
+static int inc_txqtail(struct ks_wlan_private *priv)
+{
+	priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE;
+	return 0;
+}
+
+static int inc_rxqtail(struct ks_wlan_private *priv)
+{
+	priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE;
+	return 0;
+}
+
+static int inc_rxqhead(struct ks_wlan_private *priv)
+{
+	priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE;
+	return 0;
+}
+
+static int cnt_rxqbody(struct ks_wlan_private *priv)
+{
+	return  (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE);
+}
+
+static int cnt_txqbody(struct ks_wlan_private *priv)
+{
+	return (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE);
+}
 
 /* Read single byte from device address into byte (CMD52) */
 static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread
* [PATCH] staging: ks7010: fix styling WARNINGs
@ 2017-06-30  4:52 Mark Rogers
  2017-06-30  5:54 ` Frans Klaver
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Rogers @ 2017-06-30  4:52 UTC (permalink / raw)
  To: gregkh; +Cc: mail, Tobin C. Harding, sayli karnik, devel, linux-kernel

Trivial style changes. There are still 3 "line over 80 characters"
checkpatch.pl warnings, but I think they are best left alone as
breaking the first two warning lines could hurt readability. The third
warning is a message that should not be broken for the sake of grep.

All but one of the changes fix lines that exceed 80 characters. An
embedded function name was replaced by __func__ as well.

Signed-off-by: Mark Rogers <mail@mark-rogers.org>
---
 drivers/staging/ks7010/ks7010_sdio.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index c325f48..6c0c6b2 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -548,7 +548,8 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 			if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
 				if (cnt_txqbody(priv)) {
 					ks_wlan_hw_wakeup_request(priv);
-					queue_delayed_work(priv->wq, &priv->rw_dwork, 1);
+					queue_delayed_work(priv->wq,
+							   &priv->rw_dwork, 1);
 					return;
 				}
 			} else {
@@ -693,15 +694,18 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card)
 		memcpy(rom_buf, fw_entry->data + n, size);
 
 		offset = n;
-		ret = ks7010_sdio_update_index(priv, KS7010_IRAM_ADDRESS + offset);
+		ret = ks7010_sdio_update_index(priv,
+					       KS7010_IRAM_ADDRESS + offset);
 		if (ret)
 			goto release_firmware;
 
-		ret = ks7010_sdio_write(priv, DATA_WINDOW, rom_buf, size);
+		ret = ks7010_sdio_write(priv,
+					DATA_WINDOW, rom_buf, size);
 		if (ret)
 			goto release_firmware;
 
-		ret = ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
+		ret = ks7010_sdio_data_compare(priv,
+					       DATA_WINDOW, rom_buf, size);
 		if (ret)
 			goto release_firmware;
 
@@ -889,7 +893,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	priv = netdev_priv(netdev);
 
 	card->priv = priv;
-	SET_NETDEV_DEV(netdev, &card->func->dev);	/* for create sysfs symlinks */
+	SET_NETDEV_DEV(netdev, &card->func->dev);/* for create sysfs symlinks */
 
 	/* private memory initialize */
 	priv->ks_sdio_card = card;
@@ -923,7 +927,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	}
 
 	/* interrupt setting */
-	/* clear Interrupt status write (ARMtoSD_InterruptPending FN1:00_0024) */
+	/* clear Interrupt status write (ARMtoSD_InterruptPending FN1:00_0024)*/
 	sdio_claim_host(func);
 	ret = ks7010_sdio_writeb(priv, INT_PENDING, 0xff);
 	sdio_release_host(func);
@@ -1006,7 +1010,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 	struct ks_sdio_card *card;
 	struct ks_wlan_private *priv;
 
-	DPRINTK(1, "ks7010_sdio_remove()\n");
+	DPRINTK(1, "%s()\n", __func__);
 
 	card = sdio_get_drvdata(func);
 
-- 
2.7.4

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

end of thread, other threads:[~2017-08-17 17:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-31  2:20 [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call Ashish Kalra
2017-08-01  0:25 ` Joe Perches
2017-07-31  3:15   ` [PATCH] staging: ks7010: fix styling WARNINGs Ashish Kalra
2017-08-01  1:18     ` Greg KH
2017-08-01  4:29     ` kbuild test robot
2017-08-01  4:31     ` kbuild test robot
2017-08-01 16:11     ` Ashish Kalra
2017-08-01 16:22       ` Joe Perches
2017-08-01 17:25         ` [PATCH v2]staging: " Ashish Kalra
2017-08-17 17:58           ` Greg KH
2017-08-01 20:28       ` [PATCH] staging: " Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2017-06-30  4:52 Mark Rogers
2017-06-30  5:54 ` Frans Klaver
2017-06-30 18:39   ` Mark Rogers
2017-07-11 17:27     ` Greg KH
2017-07-12  8:08     ` Frans Klaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox