Re: [PATCH] staging: ks7010: fix styling WARNINGs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <me@xxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip

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

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux