2017-08-01 00:13:31

by Ashish Kalra

[permalink] [raw]
Subject: [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call

---
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


2017-08-01 00:25:34

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] Removing Check Errors with checkpatch.pl, Converting from macro to function call

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);
> +}

2017-08-01 01:08:17

by Ashish Kalra

[permalink] [raw]
Subject: [PATCH] staging: ks7010: fix styling WARNINGs

Signed-off-by: Ashish Kalra <[email protected]>
---
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

2017-08-01 01:18:20

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: ks7010: fix styling WARNINGs

On Mon, Jul 31, 2017 at 04:15:21AM +0100, Ashish Kalra wrote:
> Signed-off-by: Ashish Kalra <[email protected]>
> ---

I can't accept patches without any changelog comments at all, sorry

2017-08-01 04:31:02

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] staging: ks7010: fix styling WARNINGs

Hi Ashish,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc3 next-20170731]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Ashish-Kalra/staging-ks7010-fix-styling-WARNINGs/20170801-121331
config: i386-randconfig-x008-201731 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All error/warnings (new ones prefixed by >>):

drivers/staging/ks7010/ks7010_sdio.c: In function 'ks7010_sdio_readb':
>> drivers/staging/ks7010/ks7010_sdio.c:77:12: error: invalid storage class for function 'ks7010_sdio_readb'
static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
^~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:77:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
^~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:89:12: error: invalid storage class for function 'ks7010_sdio_read'
static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
^~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:98:12: error: invalid storage class for function 'ks7010_sdio_writeb'
static int ks7010_sdio_writeb(struct ks_wlan_private *priv,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:110:12: error: invalid storage class for function 'ks7010_sdio_write'
static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
^~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:118:13: error: invalid storage class for function 'ks_wlan_hw_sleep_doze_request'
static void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:144:13: error: invalid storage class for function 'ks_wlan_hw_sleep_wakeup_request'
static void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:191:13: error: invalid storage class for function '_ks_wlan_hw_power_save'
static void _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:252:12: error: invalid storage class for function 'enqueue_txdev'
static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
^~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:290:12: error: invalid storage class for function 'write_to_device'
static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
^~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:320:13: error: invalid storage class for function 'tx_device_task'
static void tx_device_task(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:379:13: error: invalid storage class for function 'rx_event_task'
static void rx_event_task(unsigned long dev)
^~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:396:13: error: invalid storage class for function 'ks_wlan_hw_rx'
static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
^~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:452:13: error: invalid storage class for function 'ks7010_rw_function'
static void ks7010_rw_function(struct work_struct *work)
^~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:522:13: error: invalid storage class for function 'ks_sdio_interrupt'
static void ks_sdio_interrupt(struct sdio_func *func)
^~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:593:12: error: invalid storage class for function 'trx_device_init'
static int trx_device_init(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:609:13: error: invalid storage class for function 'trx_device_exit'
static void trx_device_exit(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:625:12: error: invalid storage class for function 'ks7010_sdio_update_index'
static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:652:12: error: invalid storage class for function 'ks7010_sdio_data_compare'
static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/ks7010/ks7010_sdio.c:680:12: error: invalid storage class for function 'ks7010_upload_firmware'
static int ks7010_upload_firmware(struct ks_sdio_card *card)
^~~~~~~~~~~~~~~~~~~~~~
--
drivers/staging//ks7010/ks7010_sdio.c:1100:11: error: initializer element is not constant
.probe = ks7010_sdio_probe,
^~~~~~~~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1100:11: note: (near initialization for 'ks7010_sdio_driver.probe')
drivers/staging//ks7010/ks7010_sdio.c:1101:12: error: initializer element is not constant
.remove = ks7010_sdio_remove,
^~~~~~~~~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1101:12: note: (near initialization for 'ks7010_sdio_driver.remove')
In file included from include/linux/mmc/card.h:13:0,
from drivers/staging//ks7010/ks7010_sdio.c:13:
drivers/staging//ks7010/ks7010_sdio.c:1104:15: error: invalid storage class for function 'ks7010_sdio_driver_init'
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^
include/linux/device.h:1471:19: note: in definition of macro 'module_driver'
static int __init __driver##_init(void) \
^~~~~~~~
In file included from include/linux/printk.h:5:0,
from include/linux/kernel.h:13,
from include/asm-generic/bug.h:15,
from arch/x86/include/asm/bug.h:81,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from include/linux/firmware.h:6,
from drivers/staging//ks7010/ks7010_sdio.c:12:
drivers/staging//ks7010/ks7010_sdio.c:1104:15: error: initializer element is not constant
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^
include/linux/init.h:166:58: note: in definition of macro '__define_initcall'
__attribute__((__section__(".initcall" #id ".init"))) = fn;
^~
include/linux/init.h:200:24: note: in expansion of macro 'device_initcall'
#define __initcall(fn) device_initcall(fn)
^~~~~~~~~~~~~~~
include/linux/module.h:85:24: note: in expansion of macro '__initcall'
#define module_init(x) __initcall(x);
^~~~~~~~~~
include/linux/device.h:1475:1: note: in expansion of macro 'module_init'
module_init(__driver##_init); \
^~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1104:1: note: in expansion of macro 'module_driver'
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^~~~~~~~~~~~~
In file included from include/linux/mmc/card.h:13:0,
from drivers/staging//ks7010/ks7010_sdio.c:13:
drivers/staging//ks7010/ks7010_sdio.c:1104:15: error: invalid storage class for function 'ks7010_sdio_driver_exit'
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^
include/linux/device.h:1476:20: note: in definition of macro 'module_driver'
static void __exit __driver##_exit(void) \
^~~~~~~~
include/linux/device.h:1476:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static void __exit __driver##_exit(void) \
^
drivers/staging//ks7010/ks7010_sdio.c:1104:1: note: in expansion of macro 'module_driver'
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^~~~~~~~~~~~~
In file included from include/linux/printk.h:5:0,
from include/linux/kernel.h:13,
from include/asm-generic/bug.h:15,
from arch/x86/include/asm/bug.h:81,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from include/linux/firmware.h:6,
from drivers/staging//ks7010/ks7010_sdio.c:12:
drivers/staging//ks7010/ks7010_sdio.c:1104:15: error: initializer element is not constant
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^
include/linux/init.h:203:50: note: in definition of macro '__exitcall'
static exitcall_t __exitcall_##fn __exit_call = fn
^~
include/linux/device.h:1480:1: note: in expansion of macro 'module_exit'
module_exit(__driver##_exit);
^~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1104:1: note: in expansion of macro 'module_driver'
module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);
^~~~~~~~~~~~~
In file included from include/linux/module.h:18:0,
from drivers/staging//ks7010/ks_wlan.h:19,
from drivers/staging//ks7010/ks7010_sdio.c:18:
include/linux/moduleparam.h:27:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct __UNIQUE_ID(name) {}
^
include/linux/module.h:160:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:204:32: note: in expansion of macro 'MODULE_INFO'
#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
^~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1105:1: note: in expansion of macro 'MODULE_AUTHOR'
MODULE_AUTHOR("Sang Engineering, Qi-Hardware, KeyStream");
^~~~~~~~~~~~~
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/firmware.h:4,
from drivers/staging//ks7010/ks7010_sdio.c:12:
>> include/linux/compiler-gcc.h:188:45: error: expected declaration or statement at end of input
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^
include/linux/compiler.h:52:23: note: in definition of macro '___PASTE'
#define ___PASTE(a,b) a##b
^
include/linux/compiler-gcc.h:188:29: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/compiler.h:53:22: note: in expansion of macro '___PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^~~~~~~~
include/linux/compiler-gcc.h:188:37: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/moduleparam.h:27:10: note: in expansion of macro '__UNIQUE_ID'
struct __UNIQUE_ID(name) {}
^~~~~~~~~~~
include/linux/module.h:160:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:258:36: note: in expansion of macro 'MODULE_INFO'
#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
^~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1108:1: note: in expansion of macro 'MODULE_FIRMWARE'
MODULE_FIRMWARE(ROM_FILE);
^~~~~~~~~~~~~~~
>> include/linux/compiler-gcc.h:188:45: warning: no return statement in function returning non-void [-Wreturn-type]
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^
include/linux/compiler.h:52:23: note: in definition of macro '___PASTE'
#define ___PASTE(a,b) a##b
^
include/linux/compiler-gcc.h:188:29: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/compiler.h:53:22: note: in expansion of macro '___PASTE'
#define __PASTE(a,b) ___PASTE(a,b)
^~~~~~~~
include/linux/compiler-gcc.h:188:37: note: in expansion of macro '__PASTE'
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^~~~~~~
include/linux/moduleparam.h:27:10: note: in expansion of macro '__UNIQUE_ID'
struct __UNIQUE_ID(name) {}
^~~~~~~~~~~
include/linux/module.h:160:32: note: in expansion of macro '__MODULE_INFO'
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
include/linux/module.h:258:36: note: in expansion of macro 'MODULE_INFO'
#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
^~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:1108:1: note: in expansion of macro 'MODULE_FIRMWARE'
MODULE_FIRMWARE(ROM_FILE);
^~~~~~~~~~~~~~~
At top level:
drivers/staging//ks7010/ks7010_sdio.c:348:5: warning: 'ks_wlan_hw_tx' defined but not used [-Wunused-function]
int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
^~~~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:246:5: warning: 'ks_wlan_hw_power_save' defined but not used [-Wunused-function]
int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
^~~~~~~~~~~~~~~~~~~~~
drivers/staging//ks7010/ks7010_sdio.c:69:12: warning: 'ks7010_sdio_readb' defined but not used [-Wunused-function]
static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
^~~~~~~~~~~~~~~~~

vim +/ks7010_sdio_readb +77 drivers/staging/ks7010/ks7010_sdio.c

08aac40f0 Ashish Kalra 2017-07-31 67
08aac40f0 Ashish Kalra 2017-07-31 68 /* Read single byte from device address into byte (CMD52) */
08aac40f0 Ashish Kalra 2017-07-31 69 static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
08aac40f0 Ashish Kalra 2017-07-31 70 unsigned char *byte)
08aac40f0 Ashish Kalra 2017-07-31 71 {
08aac40f0 Ashish Kalra 2017-07-31 72 struct sdio_func *func = priv->ks_sdio_card->func;
08aac40f0 Ashish Kalra 2017-07-31 73 int ret;
08aac40f0 Ashish Kalra 2017-07-31 74
08aac40f0 Ashish Kalra 2017-07-31 75 *byte = sdio_readb(func, address, &ret);
f1e79f4b9 Tobin C. Harding 2017-04-18 76 /* Read single byte from device address into byte (CMD52) */
f1e79f4b9 Tobin C. Harding 2017-04-18 @77 static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int address,
f1e79f4b9 Tobin C. Harding 2017-04-18 78 unsigned char *byte)
4c0d46d2c Wolfram Sang 2016-06-17 79 {
f1e79f4b9 Tobin C. Harding 2017-04-18 80 struct sdio_func *func = priv->ks_sdio_card->func;
1770ae9d3 Tobin C. Harding 2017-03-21 81 int ret;
4c0d46d2c Wolfram Sang 2016-06-17 82
f1e79f4b9 Tobin C. Harding 2017-04-18 83 *byte = sdio_readb(func, address, &ret);
4c0d46d2c Wolfram Sang 2016-06-17 84
1770ae9d3 Tobin C. Harding 2017-03-21 85 return ret;
1770ae9d3 Tobin C. Harding 2017-03-21 86 }
4c0d46d2c Wolfram Sang 2016-06-17 87
f1e79f4b9 Tobin C. Harding 2017-04-18 88 /* Read length bytes from device address into buffer (CMD53) */
f1e79f4b9 Tobin C. Harding 2017-04-18 @89 static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
f1e79f4b9 Tobin C. Harding 2017-04-18 90 unsigned char *buffer, int length)
f1e79f4b9 Tobin C. Harding 2017-04-18 91 {
f1e79f4b9 Tobin C. Harding 2017-04-18 92 struct sdio_func *func = priv->ks_sdio_card->func;
f1e79f4b9 Tobin C. Harding 2017-04-18 93
f1e79f4b9 Tobin C. Harding 2017-04-18 94 return sdio_memcpy_fromio(func, buffer, address, length);
4c0d46d2c Wolfram Sang 2016-06-17 95 }
4c0d46d2c Wolfram Sang 2016-06-17 96
f1e79f4b9 Tobin C. Harding 2017-04-18 97 /* Write single byte to device address (CMD52) */
f1e79f4b9 Tobin C. Harding 2017-04-18 @98 static int ks7010_sdio_writeb(struct ks_wlan_private *priv,
f1e79f4b9 Tobin C. Harding 2017-04-18 99 unsigned int address, unsigned char byte)
4c0d46d2c Wolfram Sang 2016-06-17 100 {
f1e79f4b9 Tobin C. Harding 2017-04-18 101 struct sdio_func *func = priv->ks_sdio_card->func;
1770ae9d3 Tobin C. Harding 2017-03-21 102 int ret;
4c0d46d2c Wolfram Sang 2016-06-17 103
f1e79f4b9 Tobin C. Harding 2017-04-18 104 sdio_writeb(func, byte, address, &ret);
4c0d46d2c Wolfram Sang 2016-06-17 105
1770ae9d3 Tobin C. Harding 2017-03-21 106 return ret;
1770ae9d3 Tobin C. Harding 2017-03-21 107 }
4c0d46d2c Wolfram Sang 2016-06-17 108
f1e79f4b9 Tobin C. Harding 2017-04-18 109 /* Write length bytes to device address from buffer (CMD53) */
f1e79f4b9 Tobin C. Harding 2017-04-18 @110 static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
f1e79f4b9 Tobin C. Harding 2017-04-18 111 unsigned char *buffer, int length)
f1e79f4b9 Tobin C. Harding 2017-04-18 112 {
f1e79f4b9 Tobin C. Harding 2017-04-18 113 struct sdio_func *func = priv->ks_sdio_card->func;
f1e79f4b9 Tobin C. Harding 2017-04-18 114
f1e79f4b9 Tobin C. Harding 2017-04-18 115 return sdio_memcpy_toio(func, address, buffer, length);
4c0d46d2c Wolfram Sang 2016-06-17 116 }
4c0d46d2c Wolfram Sang 2016-06-17 117
4433459a4 Sergio Paracuellos 2016-09-27 @118 static void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
13a9930d1 Wolfram Sang 2016-05-31 119 {
1770ae9d3 Tobin C. Harding 2017-03-21 120 int ret;
13a9930d1 Wolfram Sang 2016-05-31 121
13a9930d1 Wolfram Sang 2016-05-31 122 DPRINTK(4, "\n");
13a9930d1 Wolfram Sang 2016-05-31 123
13a9930d1 Wolfram Sang 2016-05-31 124 /* clear request */
13a9930d1 Wolfram Sang 2016-05-31 125 atomic_set(&priv->sleepstatus.doze_request, 0);
13a9930d1 Wolfram Sang 2016-05-31 126
13a9930d1 Wolfram Sang 2016-05-31 127 if (atomic_read(&priv->sleepstatus.status) == 0) {
f1e79f4b9 Tobin C. Harding 2017-04-18 128 ret = ks7010_sdio_writeb(priv, GCR_B, GCR_B_DOZE);
1770ae9d3 Tobin C. Harding 2017-03-21 129 if (ret) {
f1e79f4b9 Tobin C. Harding 2017-04-18 130 DPRINTK(1, " error : GCR_B\n");
f283dd690 Tobin C. Harding 2017-03-21 131 goto set_sleep_mode;
13a9930d1 Wolfram Sang 2016-05-31 132 }
13a9930d1 Wolfram Sang 2016-05-31 133 DPRINTK(3, "sleep_mode=SLP_SLEEP\n");
13a9930d1 Wolfram Sang 2016-05-31 134 atomic_set(&priv->sleepstatus.status, 1);
13a9930d1 Wolfram Sang 2016-05-31 135 priv->last_doze = jiffies;
cdf6ecc5e Wolfram Sang 2016-05-31 136 } else {
13a9930d1 Wolfram Sang 2016-05-31 137 DPRINTK(1, "sleep_mode=%d\n", priv->sleep_mode);
13a9930d1 Wolfram Sang 2016-05-31 138 }
13a9930d1 Wolfram Sang 2016-05-31 139
f283dd690 Tobin C. Harding 2017-03-21 140 set_sleep_mode:
13a9930d1 Wolfram Sang 2016-05-31 141 priv->sleep_mode = atomic_read(&priv->sleepstatus.status);
13a9930d1 Wolfram Sang 2016-05-31 142 }
13a9930d1 Wolfram Sang 2016-05-31 143
4433459a4 Sergio Paracuellos 2016-09-27 @144 static void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
13a9930d1 Wolfram Sang 2016-05-31 145 {
1770ae9d3 Tobin C. Harding 2017-03-21 146 int ret;
13a9930d1 Wolfram Sang 2016-05-31 147
13a9930d1 Wolfram Sang 2016-05-31 148 DPRINTK(4, "\n");
13a9930d1 Wolfram Sang 2016-05-31 149
13a9930d1 Wolfram Sang 2016-05-31 150 /* clear request */
13a9930d1 Wolfram Sang 2016-05-31 151 atomic_set(&priv->sleepstatus.wakeup_request, 0);
13a9930d1 Wolfram Sang 2016-05-31 152
13a9930d1 Wolfram Sang 2016-05-31 153 if (atomic_read(&priv->sleepstatus.status) == 1) {
f1e79f4b9 Tobin C. Harding 2017-04-18 154 ret = ks7010_sdio_writeb(priv, WAKEUP, WAKEUP_REQ);
1770ae9d3 Tobin C. Harding 2017-03-21 155 if (ret) {
f1e79f4b9 Tobin C. Harding 2017-04-18 156 DPRINTK(1, " error : WAKEUP\n");
f283dd690 Tobin C. Harding 2017-03-21 157 goto set_sleep_mode;
13a9930d1 Wolfram Sang 2016-05-31 158 }
f1e79f4b9 Tobin C. Harding 2017-04-18 159 DPRINTK(4, "wake up : WAKEUP\n");
13a9930d1 Wolfram Sang 2016-05-31 160 atomic_set(&priv->sleepstatus.status, 0);
13a9930d1 Wolfram Sang 2016-05-31 161 priv->last_wakeup = jiffies;
13a9930d1 Wolfram Sang 2016-05-31 162 ++priv->wakeup_count;
cdf6ecc5e Wolfram Sang 2016-05-31 163 } else {
13a9930d1 Wolfram Sang 2016-05-31 164 DPRINTK(1, "sleep_mode=%d\n", priv->sleep_mode);
13a9930d1 Wolfram Sang 2016-05-31 165 }
13a9930d1 Wolfram Sang 2016-05-31 166
f283dd690 Tobin C. Harding 2017-03-21 167 set_sleep_mode:
13a9930d1 Wolfram Sang 2016-05-31 168 priv->sleep_mode = atomic_read(&priv->sleepstatus.status);
13a9930d1 Wolfram Sang 2016-05-31 169 }
13a9930d1 Wolfram Sang 2016-05-31 170
feedcf1a5 Wolfram Sang 2016-05-31 171 void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
13a9930d1 Wolfram Sang 2016-05-31 172 {
1770ae9d3 Tobin C. Harding 2017-03-21 173 int ret;
13a9930d1 Wolfram Sang 2016-05-31 174
13a9930d1 Wolfram Sang 2016-05-31 175 DPRINTK(4, "\n");
13a9930d1 Wolfram Sang 2016-05-31 176 if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
f1e79f4b9 Tobin C. Harding 2017-04-18 177 ret = ks7010_sdio_writeb(priv, WAKEUP, WAKEUP_REQ);
1770ae9d3 Tobin C. Harding 2017-03-21 178 if (ret)
f1e79f4b9 Tobin C. Harding 2017-04-18 179 DPRINTK(1, " error : WAKEUP\n");
f1e79f4b9 Tobin C. Harding 2017-04-18 180 else
f1e79f4b9 Tobin C. Harding 2017-04-18 181 DPRINTK(4, "wake up : WAKEUP\n");
53638cef8 sayli karnik 2016-09-18 182
13a9930d1 Wolfram Sang 2016-05-31 183 priv->last_wakeup = jiffies;
13a9930d1 Wolfram Sang 2016-05-31 184 ++priv->wakeup_count;
cdf6ecc5e Wolfram Sang 2016-05-31 185 } else {
cdf6ecc5e Wolfram Sang 2016-05-31 186 DPRINTK(1, "psstatus=%d\n",
cdf6ecc5e Wolfram Sang 2016-05-31 187 atomic_read(&priv->psstatus.status));
13a9930d1 Wolfram Sang 2016-05-31 188 }
13a9930d1 Wolfram Sang 2016-05-31 189 }
13a9930d1 Wolfram Sang 2016-05-31 190
fa740a9e2 Tobin C. Harding 2017-04-10 @191 static void _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
13a9930d1 Wolfram Sang 2016-05-31 192 {
f1e79f4b9 Tobin C. Harding 2017-04-18 193 unsigned char byte;
f71724871 Tobin C. Harding 2017-04-10 194 int ret;
13a9930d1 Wolfram Sang 2016-05-31 195
8fb8e05cc Tobin C. Harding 2017-04-27 196 if (priv->reg.power_mgmt == POWER_MGMT_ACTIVE)
fa740a9e2 Tobin C. Harding 2017-04-10 197 return;
13a9930d1 Wolfram Sang 2016-05-31 198
482c03c7b Tobin C. Harding 2017-04-10 199 if (priv->reg.operation_mode != MODE_INFRASTRUCTURE)
482c03c7b Tobin C. Harding 2017-04-10 200 return;
482c03c7b Tobin C. Harding 2017-04-10 201
0e24eb8ab Tobin C. Harding 2017-04-27 202 if (!is_connect_status(priv->connect_status))
fa740a9e2 Tobin C. Harding 2017-04-10 203 return;
d5f1db31f Tobin C. Harding 2017-02-27 204
d5f1db31f Tobin C. Harding 2017-02-27 205 if (priv->dev_state != DEVICE_STATE_SLEEP)
fa740a9e2 Tobin C. Harding 2017-04-10 206 return;
d5f1db31f Tobin C. Harding 2017-02-27 207
3188bc092 Tobin C. Harding 2017-02-27 208 if (atomic_read(&priv->psstatus.status) == PS_SNOOZE)
fa740a9e2 Tobin C. Harding 2017-04-10 209 return;
3188bc092 Tobin C. Harding 2017-02-27 210
cdf6ecc5e Wolfram Sang 2016-05-31 211 DPRINTK(5, "\npsstatus.status=%d\npsstatus.confirm_wait=%d\npsstatus.snooze_guard=%d\ncnt_txqbody=%d\n",
13a9930d1 Wolfram Sang 2016-05-31 212 atomic_read(&priv->psstatus.status),
13a9930d1 Wolfram Sang 2016-05-31 213 atomic_read(&priv->psstatus.confirm_wait),
13a9930d1 Wolfram Sang 2016-05-31 214 atomic_read(&priv->psstatus.snooze_guard),
13a9930d1 Wolfram Sang 2016-05-31 215 cnt_txqbody(priv));
13a9930d1 Wolfram Sang 2016-05-31 216
fa740a9e2 Tobin C. Harding 2017-04-10 217 if (atomic_read(&priv->psstatus.confirm_wait) ||
fa740a9e2 Tobin C. Harding 2017-04-10 218 atomic_read(&priv->psstatus.snooze_guard) ||
fa740a9e2 Tobin C. Harding 2017-04-10 219 cnt_txqbody(priv)) {
18bd6dd1f Tobin C. Harding 2017-04-18 220 queue_delayed_work(priv->wq, &priv->rw_dwork, 0);
fa740a9e2 Tobin C. Harding 2017-04-10 221 return;
fa740a9e2 Tobin C. Harding 2017-04-10 222 }
fa740a9e2 Tobin C. Harding 2017-04-10 223
f1e79f4b9 Tobin C. Harding 2017-04-18 224 ret = ks7010_sdio_readb(priv, INT_PENDING, &byte);
f71724871 Tobin C. Harding 2017-04-10 225 if (ret) {
f1e79f4b9 Tobin C. Harding 2017-04-18 226 DPRINTK(1, " error : INT_PENDING\n");
f8641485f Tobin C. Harding 2017-04-10 227 goto queue_delayed_work;
13a9930d1 Wolfram Sang 2016-05-31 228 }
f1e79f4b9 Tobin C. Harding 2017-04-18 229 if (byte)
f8641485f Tobin C. Harding 2017-04-10 230 goto queue_delayed_work;
fa740a9e2 Tobin C. Harding 2017-04-10 231
f1e79f4b9 Tobin C. Harding 2017-04-18 232 ret = ks7010_sdio_writeb(priv, GCR_B, GCR_B_DOZE);
f71724871 Tobin C. Harding 2017-04-10 233 if (ret) {
f1e79f4b9 Tobin C. Harding 2017-04-18 234 DPRINTK(1, " error : GCR_B\n");
f8641485f Tobin C. Harding 2017-04-10 235 goto queue_delayed_work;
13a9930d1 Wolfram Sang 2016-05-31 236 }
9f9d7030e Tobin C. Harding 2017-02-27 237 atomic_set(&priv->psstatus.status, PS_SNOOZE);
dad5980e3 Tobin C. Harding 2017-02-27 238 DPRINTK(3, "psstatus.status=PS_SNOOZE\n");
13a9930d1 Wolfram Sang 2016-05-31 239
fa740a9e2 Tobin C. Harding 2017-04-10 240 return;
f8641485f Tobin C. Harding 2017-04-10 241
f8641485f Tobin C. Harding 2017-04-10 242 queue_delayed_work:
18bd6dd1f Tobin C. Harding 2017-04-18 243 queue_delayed_work(priv->wq, &priv->rw_dwork, 1);
13a9930d1 Wolfram Sang 2016-05-31 244 }
13a9930d1 Wolfram Sang 2016-05-31 245
feedcf1a5 Wolfram Sang 2016-05-31 246 int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
13a9930d1 Wolfram Sang 2016-05-31 247 {
18bd6dd1f Tobin C. Harding 2017-04-18 248 queue_delayed_work(priv->wq, &priv->rw_dwork, 1);
13a9930d1 Wolfram Sang 2016-05-31 249 return 0;
13a9930d1 Wolfram Sang 2016-05-31 250 }
13a9930d1 Wolfram Sang 2016-05-31 251
cdf6ecc5e Wolfram Sang 2016-05-31 @252 static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
cdf6ecc5e Wolfram Sang 2016-05-31 253 unsigned long size,
055da4f9b Tobin C. Harding 2017-04-18 254 void (*complete_handler)(struct ks_wlan_private *priv,
055da4f9b Tobin C. Harding 2017-04-18 255 struct sk_buff *skb),
055da4f9b Tobin C. Harding 2017-04-18 256 struct sk_buff *skb)
13a9930d1 Wolfram Sang 2016-05-31 257 {
13a9930d1 Wolfram Sang 2016-05-31 258 struct tx_device_buffer *sp;
1770ae9d3 Tobin C. Harding 2017-03-21 259 int ret;
13a9930d1 Wolfram Sang 2016-05-31 260
13a9930d1 Wolfram Sang 2016-05-31 261 if (priv->dev_state < DEVICE_STATE_BOOT) {
1770ae9d3 Tobin C. Harding 2017-03-21 262 ret = -EPERM;
aa6ca807b Tobin C. Harding 2017-03-14 263 goto err_complete;
13a9930d1 Wolfram Sang 2016-05-31 264 }
13a9930d1 Wolfram Sang 2016-05-31 265
13a9930d1 Wolfram Sang 2016-05-31 266 if ((TX_DEVICE_BUFF_SIZE - 1) <= cnt_txqbody(priv)) {
13a9930d1 Wolfram Sang 2016-05-31 267 DPRINTK(1, "tx buffer overflow\n");
1770ae9d3 Tobin C. Harding 2017-03-21 268 ret = -EOVERFLOW;
aa6ca807b Tobin C. Harding 2017-03-14 269 goto err_complete;
13a9930d1 Wolfram Sang 2016-05-31 270 }
13a9930d1 Wolfram Sang 2016-05-31 271
13a9930d1 Wolfram Sang 2016-05-31 272 sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qtail];
13a9930d1 Wolfram Sang 2016-05-31 273 sp->sendp = p;
13a9930d1 Wolfram Sang 2016-05-31 274 sp->size = size;
13a9930d1 Wolfram Sang 2016-05-31 275 sp->complete_handler = complete_handler;
055da4f9b Tobin C. Harding 2017-04-18 276 sp->skb = skb;
13a9930d1 Wolfram Sang 2016-05-31 277 inc_txqtail(priv);
13a9930d1 Wolfram Sang 2016-05-31 278
13a9930d1 Wolfram Sang 2016-05-31 279 return 0;
aa6ca807b Tobin C. Harding 2017-03-14 280
aa6ca807b Tobin C. Harding 2017-03-14 281 err_complete:
aa6ca807b Tobin C. Harding 2017-03-14 282 kfree(p);
aa6ca807b Tobin C. Harding 2017-03-14 283 if (complete_handler)
055da4f9b Tobin C. Harding 2017-04-18 284 (*complete_handler)(priv, skb);
aa6ca807b Tobin C. Harding 2017-03-14 285
1770ae9d3 Tobin C. Harding 2017-03-21 286 return ret;
13a9930d1 Wolfram Sang 2016-05-31 287 }
13a9930d1 Wolfram Sang 2016-05-31 288

:::::: The code at line 77 was first introduced by commit
:::::: f1e79f4b96c1fa21dfbfda48d511cc88c84e875f staging: ks7010: refactor SDIO read/write helpers

:::::: TO: Tobin C. Harding <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (30.20 kB)
.config.gz (26.25 kB)
Download all attachments

2017-08-01 04:32:55

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] staging: ks7010: fix styling WARNINGs

Hi Ashish,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc3 next-20170731]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Ashish-Kalra/staging-ks7010-fix-styling-WARNINGs/20170801-121331
config: tile-allmodconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=tile

All errors (new ones prefixed by >>):

drivers/staging//ks7010/ks7010_sdio.c: In function 'ks7010_sdio_readb':
drivers/staging//ks7010/ks7010_sdio.c:77:12: error: invalid storage class for function 'ks7010_sdio_readb'
drivers/staging//ks7010/ks7010_sdio.c:77:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
drivers/staging//ks7010/ks7010_sdio.c:89:12: error: invalid storage class for function 'ks7010_sdio_read'
drivers/staging//ks7010/ks7010_sdio.c:98:12: error: invalid storage class for function 'ks7010_sdio_writeb'
drivers/staging//ks7010/ks7010_sdio.c:110:12: error: invalid storage class for function 'ks7010_sdio_write'
drivers/staging//ks7010/ks7010_sdio.c:118:13: error: invalid storage class for function 'ks_wlan_hw_sleep_doze_request'
drivers/staging//ks7010/ks7010_sdio.c:144:13: error: invalid storage class for function 'ks_wlan_hw_sleep_wakeup_request'
drivers/staging//ks7010/ks7010_sdio.c:191:13: error: invalid storage class for function '_ks_wlan_hw_power_save'
drivers/staging//ks7010/ks7010_sdio.c:252:12: error: invalid storage class for function 'enqueue_txdev'
drivers/staging//ks7010/ks7010_sdio.c:290:12: error: invalid storage class for function 'write_to_device'
drivers/staging//ks7010/ks7010_sdio.c:320:13: error: invalid storage class for function 'tx_device_task'
drivers/staging//ks7010/ks7010_sdio.c:379:13: error: invalid storage class for function 'rx_event_task'
drivers/staging//ks7010/ks7010_sdio.c:396:13: error: invalid storage class for function 'ks_wlan_hw_rx'
drivers/staging//ks7010/ks7010_sdio.c:452:13: error: invalid storage class for function 'ks7010_rw_function'
drivers/staging//ks7010/ks7010_sdio.c:522:13: error: invalid storage class for function 'ks_sdio_interrupt'
drivers/staging//ks7010/ks7010_sdio.c:593:12: error: invalid storage class for function 'trx_device_init'
drivers/staging//ks7010/ks7010_sdio.c:609:13: error: invalid storage class for function 'trx_device_exit'
drivers/staging//ks7010/ks7010_sdio.c:625:12: error: invalid storage class for function 'ks7010_sdio_update_index'
drivers/staging//ks7010/ks7010_sdio.c:652:12: error: invalid storage class for function 'ks7010_sdio_data_compare'
drivers/staging//ks7010/ks7010_sdio.c:680:12: error: invalid storage class for function 'ks7010_upload_firmware'
drivers/staging//ks7010/ks7010_sdio.c:775:13: error: invalid storage class for function 'ks7010_card_init'
drivers/staging//ks7010/ks7010_sdio.c:828:13: error: invalid storage class for function 'ks7010_init_defaults'
drivers/staging//ks7010/ks7010_sdio.c:855:12: error: invalid storage class for function 'ks7010_sdio_probe'
drivers/staging//ks7010/ks7010_sdio.c:1005:12: error: invalid storage class for function 'send_stop_request'
drivers/staging//ks7010/ks7010_sdio.c:1032:13: error: invalid storage class for function 'ks7010_sdio_remove'
drivers/staging//ks7010/ks7010_sdio.c:1100:2: error: initializer element is not constant
drivers/staging//ks7010/ks7010_sdio.c:1100:2: error: (near initialization for 'ks7010_sdio_driver.probe')
drivers/staging//ks7010/ks7010_sdio.c:1101:2: error: initializer element is not constant
drivers/staging//ks7010/ks7010_sdio.c:1101:2: error: (near initialization for 'ks7010_sdio_driver.remove')
drivers/staging//ks7010/ks7010_sdio.c:1104:1: error: invalid storage class for function 'ks7010_sdio_driver_init'
>> drivers/staging//ks7010/ks7010_sdio.c:1104:1: error: invalid storage class for function '__inittest'
drivers/staging//ks7010/ks7010_sdio.c:1104:1: warning: 'alias' attribute ignored [-Wattributes]
drivers/staging//ks7010/ks7010_sdio.c:1104:1: error: invalid storage class for function 'ks7010_sdio_driver_exit'
drivers/staging//ks7010/ks7010_sdio.c:1104:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
>> drivers/staging//ks7010/ks7010_sdio.c:1104:1: error: invalid storage class for function '__exittest'
drivers/staging//ks7010/ks7010_sdio.c:1104:1: warning: 'alias' attribute ignored [-Wattributes]
drivers/staging//ks7010/ks7010_sdio.c:1105:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
drivers/staging//ks7010/ks7010_sdio.c:1108:1: error: expected declaration or statement at end of input
drivers/staging//ks7010/ks7010_sdio.c:1108:1: warning: no return statement in function returning non-void [-Wreturn-type]
drivers/staging//ks7010/ks7010_sdio.c: At top level:
drivers/staging//ks7010/ks7010_sdio.c:69:12: warning: 'ks7010_sdio_readb' defined but not used [-Wunused-function]

vim +/__inittest +1104 drivers/staging//ks7010/ks7010_sdio.c

13a9930d Wolfram Sang 2016-05-31 1096
4c0d46d2 Wolfram Sang 2016-06-17 1097 static struct sdio_driver ks7010_sdio_driver = {
4c0d46d2 Wolfram Sang 2016-06-17 1098 .name = "ks7010_sdio",
4c0d46d2 Wolfram Sang 2016-06-17 1099 .id_table = ks7010_sdio_ids,
4c0d46d2 Wolfram Sang 2016-06-17 @1100 .probe = ks7010_sdio_probe,
4c0d46d2 Wolfram Sang 2016-06-17 1101 .remove = ks7010_sdio_remove,
4c0d46d2 Wolfram Sang 2016-06-17 1102 };
4c0d46d2 Wolfram Sang 2016-06-17 1103
6b0cb0b0 Wolfram Sang 2016-05-31 @1104 module_driver(ks7010_sdio_driver, sdio_register_driver, sdio_unregister_driver);

:::::: The code at line 1104 was first introduced by commit
:::::: 6b0cb0b02ec8c03a16d1bdff4ae79b27874138e1 staging: ks7010: simplify module_init/exit

:::::: TO: Wolfram Sang <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (6.26 kB)
.config.gz (48.64 kB)
Download all attachments

2017-08-01 16:12:58

by Ashish Kalra

[permalink] [raw]
Subject: [PATCH] staging: ks7010: fix styling WARNINGs

Signed-off-by: Ashish Kalra <[email protected]>
---
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

2017-08-01 16:23:13

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] staging: ks7010: fix styling WARNINGs

On Tue, 2017-08-01 at 17:11 +0100, Ashish Kalra wrote:
> Signed-off-by: Ashish Kalra <[email protected]>

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?

2017-08-01 17:25:54

by Ashish Kalra

[permalink] [raw]
Subject: [PATCH v2]staging: ks7010: fix styling WARNINGs

Signed-off-by: Ashish Kalra <[email protected]>

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

2017-08-01 20:29:00

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] staging: ks7010: fix styling WARNINGs

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

2017-08-17 17:58:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2]staging: ks7010: fix styling WARNINGs

On Tue, Aug 01, 2017 at 06:25:36PM +0100, Ashish Kalra wrote:
> Signed-off-by: Ashish Kalra <[email protected]>
>
> 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

Why is all of this stuff below the signed-off-by line?

Please fix this up properly, and read the documentation for how to
submit a patch in Documentation/SubmittingPatches.

thanks,

greg k-h