Re: [PATCH 2/4] staging: rtl8188eu: remove constant variable and dead code
Hi Martin, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on staging/staging-testing] url: https://github.com/0day-ci/linux/commits/Martin-Kaiser/staging-rtl8188eu-change-bLeisurePs-type-to-bool/20210418-020200 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 71d3edc61e29e45b613b841108688d711846f969 config: arc-allyesconfig (attached as .config) compiler: arceb-elf-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/c2b80185c47f9f13ed748eca0df39494668481ee git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Martin-Kaiser/staging-rtl8188eu-change-bLeisurePs-type-to-bool/20210418-020200 git checkout c2b80185c47f9f13ed748eca0df39494668481ee # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/staging/rtl8188eu/os_dep/rtw_android.c:60: warning: Function parameter or member 'cmdstr' not described in 'rtw_android_cmdstr_to_num' >> drivers/staging/rtl8188eu/os_dep/rtw_android.c:60: warning: expecting >> prototype for functions(). Prototype was for rtw_android_cmdstr_to_num() >> instead vim +60 drivers/staging/rtl8188eu/os_dep/rtw_android.c 5adef66acf7370 Larry Finger 2013-08-21 54 5adef66acf7370 Larry Finger 2013-08-21 55 /** c2b80185c47f9f Martin Kaiser2021-04-17 56 * Local (static) functions 5adef66acf7370 Larry Finger 2013-08-21 57 */ 5adef66acf7370 Larry Finger 2013-08-21 58 5adef66acf7370 Larry Finger 2013-08-21 59 int rtw_android_cmdstr_to_num(char *cmdstr) 5adef66acf7370 Larry Finger 2013-08-21 @60 { 5adef66acf7370 Larry Finger 2013-08-21 61 int cmd_num; 37ad17a4b48ca7 Yamanappagouda Patil 2016-12-22 62 5adef66acf7370 Larry Finger 2013-08-21 63 for (cmd_num = 0; cmd_num < ANDROID_WIFI_CMD_MAX; cmd_num++) fd078b42096163 Puranjay Mohan 2019-05-21 64 if (!strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num], 5adef66acf7370 Larry Finger 2013-08-21 65 strlen(android_wifi_cmd_str[cmd_num]))) 5adef66acf7370 Larry Finger 2013-08-21 66 break; 5adef66acf7370 Larry Finger 2013-08-21 67 return cmd_num; 5adef66acf7370 Larry Finger 2013-08-21 68 } 5adef66acf7370 Larry Finger 2013-08-21 69 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip
[PATCH 2/4] staging: rtl8188eu: remove constant variable and dead code
g_wifi_on is always true. Remove the variable and the code that would be run only if g_wifi_on was false. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/os_dep/rtw_android.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c index f5763a9d70c5..2d21767bc1a3 100644 --- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c +++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c @@ -53,15 +53,9 @@ struct android_wifi_priv_cmd { }; /** - * Local (static) functions and variables + * Local (static) functions */ -/* Initialize g_wifi_on to 1 so dhd_bus_start will be called for the first - * time (only) in dhd_open, subsequential wifi on will be handled by - * wl_android_wifi_on - */ -static int g_wifi_on = true; - int rtw_android_cmdstr_to_num(char *cmdstr) { int cmd_num; @@ -154,12 +148,6 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) case ANDROID_WIFI_CMD_SETFWPATH: goto response; } - if (!g_wifi_on) { - DBG_88E("%s: Ignore private cmd \"%s\" - iface %s is down\n", - __func__, command, ifr->ifr_name); - ret = 0; - goto free; - } switch (cmd_num) { case ANDROID_WIFI_CMD_STOP: break; @@ -244,7 +232,6 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) } else { ret = bytes_written; } -free: kfree(command); return ret; } -- 2.20.1