fix following post-commit hook checpatch issues:
WARNING: Comparisons should place the constant on the right side of the test
287: FILE: drivers/staging/rtl8723bs/hal/sdio_halinit.c:738:
+ if (_SUCCESS != ret)
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e19cff736413714dea4265c17b512882d051a311.1618064274.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following post-commit hook checkpatch issues:
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_probe_req_ie"
348: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1319:
+ if (pmlmepriv->wps_probe_req_ie == NULL)
CHECK: Comparison to NULL could be written "!dvobj"
459: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:184:
+ if (dvobj == NULL)
CHECK: Comparison to NULL could be written "!padapter"
470: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:231:
+ if (padapter == NULL)
CHECK: Comparison to NULL could be written "!padapter"
481: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:240:
+ if (padapter == NULL)
CHECK: Comparison to NULL could be written "!padapter"
492: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:256:
+ if (padapter == NULL)
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2c7557a465aeda7fb6989df30c6250f9ec56ebe1.1618064274.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove all DBG_8192C macro definitions.
Macro DBG_8192C belongs to a family of verbose
private tracing macros.
The default behaviour is _do nothing_, to activate
it one should define DEBUG symbol by hand.
So just remove it
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e7259eeb5927d48a2920548b92dc507befa5e6af.1618064274.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove all commented out DBG_8192C logs.
Macro DBG_8192C belongs to a family of verbose
private tracing macros.
The default behaviour is _do nothing_, to activate
it one should define DEBUG symbol by hand.
So just remove it
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/d954fbde0ae689cd053a57f57f954f14b5d013cb.1618064274.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The logic here was already overriding the erroneous IO addresses
returned from of_pci_range_to_resource, which is the bulk of the logic.
So stop using it altogether and initialize the fields explicitly, as
done in aeba3731b1 ("powerpc/pci: Fix IO space breakage after
of_pci_range_to_resource() change").
Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Link: https://lore.kernel.org/r/20210410173331.57949-1-ilya.lipnitskiy@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In commit 92172da23c ("staging: rtl8192e: replace comparison to NULL
by bool") a check was changed from looking at the data to the pointer,
which was incorrect, so revert that portion of the commit to have the
proper logic restored.
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Fixes: 92172da23c ("staging: rtl8192e: replace comparison to NULL by bool")
Link: https://lore.kernel.org/r/YHG8qARLUX2KPWwI@kali
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
GCC reports the following warning with W=1:
drivers/staging/comedi/drivers/tests/ni_routes_test.c:215:45: warning:
variable 'olddevroutes' set but not used [-Wunused-but-set-variable]
215 | const struct ni_device_routes *devroutes, *olddevroutes;
| ^~~~~~~~~~~~
This variable is not used in function , this commit
remove it to fix the warning.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20210410064932.12905-1-linqiheng@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Link: https://lore.kernel.org/r/20210410035037.11322-1-cuibixuan@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixed Check: Remove unnecessary f-trace like logging by simply deleting
that statement as we have other modes of logging like ftrace.
Reported by checkpatch.
Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Link: https://lore.kernel.org/r/YHDtWizzh5EVLL4/@kali
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixed Comparison to NULL can be written as '!...' by replacing it with
simpler form i.e boolean expression. This makes code more readable alternative.
Reported by checkpatch.
Signed-off-by: Mitali Borkar <mitaliborkar810@gmail.com>
Link: https://lore.kernel.org/r/YHDnWpWztxeZospi@kali
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The variable ret is being initialized as 0 and is never used until
it's updated by sdio_register_driver()
This removes the redundant initialization of ret
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/20210409201235.407671-1-hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove obsolete MSG_8192C macro definitions.
MSG_8192C is a private trace mechanism macro and is deactivated.
(i.e. the default behaviour is _do nothing_)
The only way to activate it is to manually define a debug
symbol.
So just remove it.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/97f38f269e8dabb3dd7464d49022a62cd9773657.1617971593.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove commented out MSG_8192C log.
MSG_8192C is a private trace mechanism macro and is deactivated.
(i.e. the default behaviour is _do nothing_)
The only way to activate it is to manually define a debug
symbol.
So just remove it.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/845969563d7c90d1b7aa3215ae29dd91afc5100c.1617971592.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove all MSG_8192C logs.
MSG_8192C is a private trace mechanism macro and is deactivated.
(i.e. the default behaviour is _do nothing_)
The only way to activate it is to manually define a debug
symbol.
So just remove it.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/fa7f52aa90928dc86b3249ca9c5b27f92c2b071b.1617971592.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following kernel test robot warning:
At top level:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:36:27:
warning: 'iw_operation_mode' defined but not used
[-Wunused-const-variable=]
36 | static const char * const iw_operation_mode[] = {
| ^~~~~~~~~~~~~~~~~
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/05cc97a114269ee55ac9a91c61493c885fcc0193.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following kernel test robot warning:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:
In function ‘rtw_wx_set_mlme’:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:1128:6:
warning: variable ‘reason’ set but
not used [-Wunused-but-set-variable]
u16 reason;
^~~~~~
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/6211c4177a9ef1e677987c9ebac445df08605f40.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following kernel test robot warning:
At top level:
drivers/staging/rtl8723bs/include/rtw_security.h:336:28:
warning: 'K' defined but not used [-Wunused-const-variable=]
336 | static const unsigned long K[64] = {
| ^
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/819680ab87bbe543aba966f1fe47b209d3d8a69f.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove set but unused variable. Fix W=1 compiler warning:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:
In function ‘rtw_dbg_port’:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2443:19:
warning: variable ‘psta’ set but not used [-Wunused-but-set-variable]
struct sta_info *psta;
^~~~
Remove also the function call that sets this variable.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/62b6c48b887decdde4b5343472089665518d205b.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following kernel test robot warnings:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:
In function ‘rtw_dbg_port’:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2548:33:
warning: variable ‘preorder_ctrl’ set but
not used [-Wunused-but-set-variable]
struct recv_reorder_ctrl *preorder_ctrl;
^~~~~~~~~~~~~
remove also unnecessary conditional code block.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0e950e74565b573a98b851092cc2078045d5ac3d.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following kernel test robot warnings:
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2573:33:
warning: variable ‘preorder_ctrl’ set but
not used [-Wunused-but-set-variable]
struct recv_reorder_ctrl *preorder_ctrl;
^~~~~~~~~~~~~
remove also empty for cycle left unused and counter variable.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/fb1e8ea3cfeda1af27ab1a9393140e144b5cb4b5.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix following kernel test robot warning:
drivers/staging/rtl8723bs/core/rtw_cmd.c:
In function 'rtw_cmd_thread':
>> drivers/staging/rtl8723bs/core/rtw_cmd.c:390:16:
warning: variable 'cmd_start_time' set
but not used [-Wunused-but-set-variable]
390 | unsigned long cmd_start_time;
| ^~~~~~~~~~~~~~
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/509eeb1c4a7fcfc37b69cb8578ea146b95b50864.1617962215.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In rtw_cmd_thread's main loop, we wait until there's a command in the
queue. To skip this wait statement in subsequent iterations, the driver
uses a label and goto instead of the actual loop. We only get back to the
initial wait if the queue is empty when we read it.
Basically, all we want to do is check if there's a command in the queue.
If yes, we process it. If not, we wait until someone enqueues a command.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There's no need to set cmd_hdl to NULL after it's used. It will be set
again before the next command is processed.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There's two identical checks if the device was stopped or unplugged.
Remove one of them.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The rtl8188 driver starts a command thread that reads commands from a queue
and processes them. Each command consists of a struct cmd_obj. The command
thread may call a function to process the current command and optionally a
post-processing function. Eventually, the command's cmd_obj must be freed.
At the moment, if there's a post-processing function for the current
command, this function has to free the cmd_obj. If there's no
post-processing function, the command thread frees cmd_obj.
It's much simpler if we always leave it to the command thread to free
cmd_obj.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move the declaration of the rtw_cmd_callback array from rtw_cmd.h to
rtw_cmd.c.
The _RTW_CMD_C_ symbol is now obsolete and can be removed.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Declaring a static array in a header file is likely to cause name conflicts
if the declaration is pulled in multiple times.
The rtl8188 driver protects the declaration of the wlancmds array in
rtw_mlme_ext.h with ifdef _RTW_CMD_C_, which is defined only in rtw_cmd.c.
It makes more sense to declare the array in the .c file.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>