Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1700531 > unrolled thread
| Started by | Ashish Kalra <eashishkalra@gmail.com> |
|---|---|
| First post | 2017-08-01 02:20 +0200 |
| Last post | 2017-08-01 22:30 +0200 |
| Articles | 8 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call Ashish Kalra <eashishkalra@gmail.com> - 2017-08-01 02:20 +0200
Re: [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call Joe Perches <joe@perches.com> - 2017-08-01 02:30 +0200
[PATCH] staging: ks7010: fix styling WARNINGs Ashish Kalra <eashishkalra@gmail.com> - 2017-08-01 03:10 +0200
Re: [PATCH] staging: ks7010: fix styling WARNINGs Greg KH <gregkh@linuxfoundation.org> - 2017-08-01 03:20 +0200
[PATCH] staging: ks7010: fix styling WARNINGs Ashish Kalra <eashishkalra@gmail.com> - 2017-08-01 18:20 +0200
Re: [PATCH] staging: ks7010: fix styling WARNINGs Joe Perches <joe@perches.com> - 2017-08-01 18:30 +0200
[PATCH v2]staging: ks7010: fix styling WARNINGs Ashish Kalra <eashishkalra@gmail.com> - 2017-08-01 19:30 +0200
Re: [PATCH] staging: ks7010: fix styling WARNINGs Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-01 22:30 +0200
| From | Ashish Kalra <eashishkalra@gmail.com> |
|---|---|
| Date | 2017-08-01 02:20 +0200 |
| Subject | [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call |
| Message-ID | <u9t4J-4zH-3@gated-at.bofh.it> |
---
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
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-08-01 02:30 +0200 |
| Subject | Re: [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call |
| Message-ID | <u9tep-4CU-3@gated-at.bofh.it> |
| In reply to | #1700531 |
On Mon, 2017-07-31 at 03:20 +0100, Ashish Kalra wrote:
You should not use checkpatch in the commit subject and
should use a commit message.
You also need a "Signed-off-by:" line with your legal
name and email address.
> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
[]
> @@ -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;
> +}
These functions should return void
> +
> +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);
> +}
And these should return unsigned int
> +
> +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);
> +}
[toc] | [prev] | [next] | [standalone]
| From | Ashish Kalra <eashishkalra@gmail.com> |
|---|---|
| Date | 2017-08-01 03:10 +0200 |
| Subject | [PATCH] staging: ks7010: fix styling WARNINGs |
| Message-ID | <u9tR8-57m-27@gated-at.bofh.it> |
| In reply to | #1700536 |
Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
---
Trivial style changes. There are still "line over 80 characters"
checkpatch.pl warnings, but I think they are best left alone as
breaking these could hurt readability
drivers/staging/ks7010/ks7010_sdio.c | 53 +++++++++++++++++++++++++++---------
1 file changed, 40 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 9b28ee1..72bf966 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,20 +31,48 @@
};
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)
+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);
+}
-#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)
+/* Read single byte from device address into byte (CMD52) */
+static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
+ unsigned char *byte)
+{
+ struct sdio_func *func = priv->ks_sdio_card->func;
+ int ret;
+ *byte = sdio_readb(func, address, &ret);
/* Read single byte from device address into byte (CMD52) */
static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
unsigned char *byte)
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-08-01 03:20 +0200 |
| Subject | Re: [PATCH] staging: ks7010: fix styling WARNINGs |
| Message-ID | <u9u0N-5av-7@gated-at.bofh.it> |
| In reply to | #1700562 |
On Mon, Jul 31, 2017 at 04:15:21AM +0100, Ashish Kalra wrote: > Signed-off-by: Ashish Kalra <eashishkalra@gmail.com> > --- I can't accept patches without any changelog comments at all, sorry
[toc] | [prev] | [next] | [standalone]
| From | Ashish Kalra <eashishkalra@gmail.com> |
|---|---|
| Date | 2017-08-01 18:20 +0200 |
| Subject | [PATCH] staging: ks7010: fix styling WARNINGs |
| Message-ID | <u9I3M-6bX-9@gated-at.bofh.it> |
| In reply to | #1700562 |
Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
---
drivers/staging/ks7010/ks7010_sdio.c | 47 +++++++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 14 deletions(-)
Trivial style changes. There are still "line over 80 characters"
checkpatch.pl warnings, but I think they are best left alone as
breaking these could hurt readability
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
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-08-01 18:30 +0200 |
| Subject | Re: [PATCH] staging: ks7010: fix styling WARNINGs |
| Message-ID | <u9Idr-6fm-9@gated-at.bofh.it> |
| In reply to | #1701206 |
On Tue, 2017-08-01 at 17:11 +0100, Ashish Kalra wrote:
> Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Still many issues with this patch submission:
o no commit message
o no version of patch submission in subject line
And other issues below:
> ---
> drivers/staging/ks7010/ks7010_sdio.c | 47 +++++++++++++++++++++++++-----------
> 1 file changed, 33 insertions(+), 14 deletions(-)
>
> Trivial style changes. There are still "line over 80 characters"
> checkpatch.pl warnings, but I think they are best left alone as
> breaking these could hurt readability
This message should go above the --- line and the
version information about what changed between
each submission should go below the --- line.
> diff --git 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.
> */
> -
Why is this line removed?
> #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;
> +}
Why are the functions above not returning void?
> +
> +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);
> +}
Why are these 2 functions above not returning unsigned int?
[toc] | [prev] | [next] | [standalone]
| From | Ashish Kalra <eashishkalra@gmail.com> |
|---|---|
| Date | 2017-08-01 19:30 +0200 |
| Subject | [PATCH v2]staging: ks7010: fix styling WARNINGs |
| Message-ID | <u9J9w-6UE-9@gated-at.bofh.it> |
| In reply to | #1701210 |
Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Trivial style changes. There are still "line over 80 characters"
checkpatch.pl warnings, but I think they are best left alone as
breaking these could hurt readability
v2: Updated Patch as per review comments recievd
---
drivers/staging/ks7010/ks7010_sdio.c | 42 +++++++++++++++++++++++++-----------
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 9b28ee1..091dedd 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -32,19 +32,35 @@
};
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 void inc_txqhead(struct ks_wlan_private *priv)
+{
+ priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
+}
+
+static void inc_txqtail(struct ks_wlan_private *priv)
+{
+ priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE;
+}
+
+static void inc_rxqtail(struct ks_wlan_private *priv)
+{
+ priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE;
+}
+
+static void inc_rxqhead(struct ks_wlan_private *priv)
+{
+ priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE;
+}
+
+static unsigned 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 unsigned 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
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2017-08-01 22:30 +0200 |
| Subject | Re: [PATCH] staging: ks7010: fix styling WARNINGs |
| Message-ID | <u9LXH-cC-3@gated-at.bofh.it> |
| In reply to | #1701206 |
The subject is too vague and you need a changelog.
On Tue, Aug 01, 2017 at 05:11:29PM +0100, Ashish Kalra wrote:
> +static int inc_txqhead(struct ks_wlan_private *priv)
> +{
> + priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
> + return 0;
Just make these void if no one checks the return.
regards,
dan carpenter
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web