platform/kernel/linux-rpi.git
3 years agostaging: rtl8723bs: remove unneeded comments to silence 'line too long' warning
Fabio Aiuto [Mon, 10 May 2021 13:19:33 +0000 (15:19 +0200)]
staging: rtl8723bs: remove unneeded comments to silence 'line too long' warning

remove unneeded comments to fix the following post commit hook
checkpatch warnings:

WARNING: line length of 110 exceeds 100 columns
115: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:510:
+ *((__le32 *)crc)
 = ~crc32_le(~0, payload, length);/* modified by Amy*/

WARNING: line length of 110 exceeds 100 columns
124: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:518:
+ *((__le32 *)crc)
 = ~crc32_le(~0, payload, length);/* modified by Amy*/

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/bb479715e3603ab78863576783dbbf49c5f6f703.1620652505.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace private CRC-32 routines with in-kernel ones
Fabio Aiuto [Mon, 10 May 2021 13:19:32 +0000 (15:19 +0200)]
staging: rtl8723bs: replace private CRC-32 routines with in-kernel ones

replace private CRC-32 routines with in-kernel ones.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/cdd9bc521b7119a9c2787b46109eb76f94bd295a.1620652505.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: Fix whitespace around conditional statement
Ojaswin Mujoo [Mon, 10 May 2021 11:35:24 +0000 (17:05 +0530)]
staging: rtl8192e: Fix whitespace around conditional statement

This patch fixes the following checkpatch.pl warnings:

- WARNING: suspect code indent for conditional statements (8, 17)
  FILE: ./rtl8192e/rtl8192e/rtl_dm.c:1735:

- WARNING: Statements should start on a tabstop
  FILE: ./rtl8192e/rtl8192e/rtl_dm.c:1736:

Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/b25f07b14c7e1f0d70d54b8723f786e33ffeb77a.1620642396.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: Add identifier name to function definition
Ojaswin Mujoo [Mon, 10 May 2021 11:34:17 +0000 (17:04 +0530)]
staging: rtl8192e: Add identifier name to function definition

The patch fixes the following checkpatch.pl warnings:

- WARNING: function definition argument 'struct net_device *' should also
    have an identifier name
  FILE: ./rtl8192e/rtl8192e/rtl_core.h:572:

- WARNING: function definition argument 'struct net_device *' should also
    have an identifier name
  FILE: ./rtl8192e/rtl8192e/rtl_core.h:573:

Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/d856d9f22777524f5c10bddb7f7930d97e58c20b.1620642396.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: Avoid multiple line dereference
Ojaswin Mujoo [Mon, 10 May 2021 11:31:01 +0000 (17:01 +0530)]
staging: rtl8192e: Avoid multiple line dereference

Avoid multiple line dereference to make the code more readable, as
suggested by checkpatch.pl

This patch fixes the following checkpatch.pl warning:

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:189

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:195

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:204

- WARNING: Avoid multiple line dereference
    prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
  FILE: ./rtl8192e/rtl8192e/rtl_cam.c:209

- WARNING: Avoid multiple line dereference
    prefer 'info_element->data[info_element->len]'
  FILE: ./rtl8192e/rtllib_rx.c:2287

Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/435b60bd8874f8105b4af6e7eb9ee5bdbfe3112f.1620642396.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: Delete two redundant condition branches
Zhen Lei [Mon, 10 May 2021 08:49:01 +0000 (16:49 +0800)]
staging: rtl8723bs: Delete two redundant condition branches

The statement of the "if (check_fwstate(pmlmepriv, WIFI_AP_STATE))" branch
is the same as the "else" branch. Delete it to simplify code.

No functional change.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210510084901.3421-1-thunder.leizhen@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace private arc4 encryption with in-kernel one
Fabio Aiuto [Fri, 7 May 2021 07:36:00 +0000 (09:36 +0200)]
staging: rtl8723bs: replace private arc4 encryption with in-kernel one

replace private arc4 encryption with in-kernel one.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/af960dc728f039d64f4fb28fcece3ca92d24fbe4.1620372584.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused symbolic constant _AES_IV_LEN_
Fabio Aiuto [Fri, 7 May 2021 07:35:59 +0000 (09:35 +0200)]
staging: rtl8723bs: remove unused symbolic constant _AES_IV_LEN_

remove unused symbolic constant _AES_IV_LEN_

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/ac3f5a400dcb61f46db259cca6979ec41f98feae.1620372584.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove more unused encryption macros
Fabio Aiuto [Fri, 7 May 2021 07:35:58 +0000 (09:35 +0200)]
staging: rtl8723bs: remove more unused encryption macros

remove more unused logical macros used in removed
private aes encryption.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c65d2b2dd06c52c3e0418d8a927521d05109849c.1620372584.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused macros, arrays and an inline function def
Fabio Aiuto [Fri, 7 May 2021 07:35:57 +0000 (09:35 +0200)]
staging: rtl8723bs: remove unused macros, arrays and an inline function def

remove unused macros, arrays and a function definition.
Many of these facilities were used in removed private
aes encryption.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/ada64bfc622dbfe6d4ff03c46dff48b25ebc641e.1620372584.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: Remove duplicate declartion
Saurav Girepunje [Sun, 9 May 2021 17:14:27 +0000 (22:44 +0530)]
staging: rtl8192e: Remove duplicate declartion

Remove dupilcate declartion of function rtllib_stop_send_beaconsi()
notify_wx_assoc_event() in rtl8192e/rtllib.h file.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/20210509171427.GA9937@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: add missing device_type in pcie root ports
Sergio Paracuellos [Thu, 6 May 2021 17:07:42 +0000 (19:07 +0200)]
staging: mt7621-dts: add missing device_type in pcie root ports

According to the YAML schema 'pci-bus.yaml' the 'device_type'
property is mandatory for all pcie root ports. Hence add it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210506170742.28196-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: remove 'bug-range' property
Sergio Paracuellos [Thu, 6 May 2021 17:07:41 +0000 (19:07 +0200)]
staging: mt7621-dts: remove 'bug-range' property

Property 'bus-range' when values are the default are
not necessary to be defined. Hence, remove all of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210506170742.28196-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove nic_hdl from struct mlme_priv
Martin Kaiser [Thu, 6 May 2021 12:14:10 +0000 (14:14 +0200)]
staging: rtl8188eu: remove nic_hdl from struct mlme_priv

struct mlme_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210506121410.17613-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove padapter from struct mlme_ext_priv
Martin Kaiser [Wed, 5 May 2021 20:26:22 +0000 (22:26 +0200)]
staging: rtl8188eu: remove padapter from struct mlme_ext_priv

struct mlme_ext_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210505202622.11087-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove padapter from struct cmd_priv
Martin Kaiser [Wed, 5 May 2021 20:26:20 +0000 (22:26 +0200)]
staging: rtl8188eu: remove padapter from struct cmd_priv

struct cmd_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210505202622.11087-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: don't block until cmdthread runs
Martin Kaiser [Wed, 5 May 2021 20:26:19 +0000 (22:26 +0200)]
staging: rtl8188eu: don't block until cmdthread runs

rtw_start_drv_threads starts a cmdthread that runs in a loop. It
reads a command from a queue and processes it. There's no need for
any synchronization when this thread is started.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210505202622.11087-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: rtw_init_cmd_priv never fails
Martin Kaiser [Wed, 5 May 2021 20:26:18 +0000 (22:26 +0200)]
staging: rtl8188eu: rtw_init_cmd_priv never fails

Change the return type to void. Remove unnecessary error handling.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210505202622.11087-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: make rtw_android_cmdstr_to_num static
Martin Kaiser [Wed, 5 May 2021 20:26:17 +0000 (22:26 +0200)]
staging: rtl8188eu: make rtw_android_cmdstr_to_num static

This function is used only in rtw_android.c.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210505202622.11087-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: use standard 'syscon' string
Sergio Paracuellos [Wed, 5 May 2021 13:21:54 +0000 (15:21 +0200)]
staging: mt7621-dts: use standard 'syscon' string

Both 'memc' and 'sysc' nodes are not using 'syscon'
as a node string which is the standard one to be used.
Update both of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505132154.8263-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: remove ethsys node
Sergio Paracuellos [Wed, 5 May 2021 13:21:53 +0000 (15:21 +0200)]
staging: mt7621-dts: remove ethsys node

DT 'ethsys' node is being configured as a syscon
to get access to reset and other registers in the
'mediateķ,mt7621-eth' driver. Since the 'sysc' is also
a syscon, provides the clock and also is virtually
mapped from the same physical address 0x1e000000 we
can just use 'sysc' as the phandle for the syscon in
the ethernet node. Compatible string 'mediatek,mt7621-ethsys'
of the node is not being used anywhere inside the kernel
so, this node can be safely removed.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505132154.8263-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fieldbus: anybus: Refuse registering drivers without .probe()
Uwe Kleine-König [Wed, 5 May 2021 20:29:23 +0000 (22:29 +0200)]
staging: fieldbus: anybus: Refuse registering drivers without .probe()

A driver without .probe() callback could never bind to a device because
anybus_bus_probe() returned an error for such a driver. So refuse to
register such a useless driver.

Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210505202923.198607-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fieldbus: anybus: Make remove callback return void
Uwe Kleine-König [Wed, 5 May 2021 20:29:22 +0000 (22:29 +0200)]
staging: fieldbus: anybus: Make remove callback return void

The driver core ignores the return value of struct bus_type::remove()
because there is only little that can be done. To simplify the quest to
make this function return void, let struct
anybuss_client_driver::remove() return void, too. All users already
unconditionally return 0, this commit makes it obvious that returning an
error code is a bad idea.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210505202923.198607-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: properly organize pcie node
Sergio Paracuellos [Wed, 5 May 2021 12:17:36 +0000 (14:17 +0200)]
staging: mt7621-dts: properly organize pcie node

Device tree pcie node for this SoC is using different
styles in its different properties. Hence properly
unify them to be able to write a a proper yaml schema
documentation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-11-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: use 'interrupt-map' and 'interrupt-map-mask'
Sergio Paracuellos [Wed, 5 May 2021 12:17:35 +0000 (14:17 +0200)]
staging: mt7621-dts: use 'interrupt-map' and 'interrupt-map-mask'

Custom function for 'map_irq' was introduced in
commit fab6710e4c51 ("staging: mt7621-pci: fix PCIe interrupt mapping")

This is not really necessary and code has been fixed to avoid
custom configuration of the virtual bridges and make possible
to properly map the root ports interrupts using this standard
properties. Hence properly update device tree accordly.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-10-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: remove two blank lines
Sergio Paracuellos [Wed, 5 May 2021 12:17:34 +0000 (14:17 +0200)]
staging: mt7621-pci: remove two blank lines

There are useless two blank lines in code that can
be removed. Hence, remove them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-9-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: avoid custom 'map_irq' function
Sergio Paracuellos [Wed, 5 May 2021 12:17:33 +0000 (14:17 +0200)]
staging: mt7621-pci: avoid custom 'map_irq' function

Custom function for 'map_irq' was introduced in
commit fab6710e4c51 ("staging: mt7621-pci: fix PCIe interrupt mapping")

After some testing in an adquired device with a similar
pci layout that those that was having problems, I got
into a better way to solve the issue just using device tree
'interrupt-map' and 'interrupt-map-mask' properties. For
this to be possible we must avoid custom configuration of
the virtual bridges registers from driver code. Doing in
this way buses are not reconfigured so we can properly
use bus related bits and mask in device tree to map
correctly the interrupts. Hence remove custom configuration
of the bridges as well as custom 'map_irq' related stuff.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-8-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: directly return 'mt7621_pcie_register_host'
Sergio Paracuellos [Wed, 5 May 2021 12:17:32 +0000 (14:17 +0200)]
staging: mt7621-pci: directly return 'mt7621_pcie_register_host'

Return code after call function 'mt7621_pcie_register_host' is
being checked to give an error message. This function internally
is calling 'pci_host_probe' which if something fails will complain
already. Hence, directly return result of this call making decrease
a bit LOC.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-7-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: replace mdelay with msleep
Sergio Paracuellos [Wed, 5 May 2021 12:17:31 +0000 (14:17 +0200)]
staging: mt7621-pci: replace mdelay with msleep

There are two mdelay calls in driver code located in
'mt7621_pcie_reset_assert' and 'mt7621_pcie_reset_rc_deassert'
functions. Both of them are not called in an interrupt handler
nor holding any spinlock. Hence, the function mdelay in them
can be replaced with msleep, to reduce busy wait.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-6-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: group io resource assignments all together
Sergio Paracuellos [Wed, 5 May 2021 12:17:30 +0000 (14:17 +0200)]
staging: mt7621-pci: group io resource assignments all together

To improve a bit readabily group all the IO resource related
assignments together.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-5-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: remove some not needed includes
Sergio Paracuellos [Wed, 5 May 2021 12:17:29 +0000 (14:17 +0200)]
staging: mt7621-pci: remove some not needed includes

Some includes used here are not really necessary for
the code to compile properly. Hence remove them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-4-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: avoid to set gpio mode in driver
Sergio Paracuellos [Wed, 5 May 2021 12:17:28 +0000 (14:17 +0200)]
staging: mt7621-pci: avoid to set gpio mode in driver

Gpio mode for the pcie pins must be request from device
tree using pinctrl driver. Pinctrl driver is already setting
this pcie pins as GPIO if it is requested. Hence, remove it
from here.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: make use of kernel clock apis
Sergio Paracuellos [Wed, 5 May 2021 12:17:27 +0000 (14:17 +0200)]
staging: mt7621-pci: make use of kernel clock apis

MT7621 SoC clock driver has already mainlined in
'commit 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")'
Hence, we can make use of kernel clock apis and avoid to
directly set bits in clock gate related registers for pci.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: use in-kernel aes encryption
Fabio Aiuto [Tue, 4 May 2021 14:51:40 +0000 (16:51 +0200)]
staging: rtl8723bs: use in-kernel aes encryption

replace private aes encryption subroutines with
public in-kernel ones in data frame encryption.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/bd1f47994d3a1d0f434de5b2095c327f5a25f6ef.1620139727.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: use in-kernel aes encryption in OMAC1 routines
Fabio Aiuto [Tue, 4 May 2021 14:51:39 +0000 (16:51 +0200)]
staging: rtl8723bs: use in-kernel aes encryption in OMAC1 routines

replace private aes encryption subroutines with
public in-kernel ones in OMAC1 computation routines.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/11ac26487aab92ded28747c1f0cb42a94183130d.1620139727.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: align argument position in a new line
Fabio Aiuto [Tue, 4 May 2021 14:51:38 +0000 (16:51 +0200)]
staging: rtl8723bs: align argument position in a new line

align function arguments position on a new line to
open parentheses.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/f195bc7d72c122e5e16b3857cf99ae1f84734915.1620139727.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fbtft: Update TODO
Andy Shevchenko [Mon, 3 May 2021 17:21:14 +0000 (20:21 +0300)]
staging: fbtft: Update TODO

Now, after a few fixes we may consider the conversion to
the GPIO descriptor API is done.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fbtft: Replace custom ->reset() with generic one
Andy Shevchenko [Mon, 3 May 2021 17:21:13 +0000 (20:21 +0300)]
staging: fbtft: Replace custom ->reset() with generic one

The custom ->reset() repeats the generic one, replace it.

Note, in newer kernels the context of the function is a sleeping one,
it's fine to switch over to the sleeping functions. Keeping the reset
line asserted longer than 20 microseconds is also okay, it's an idling
state of the hardware.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fbtft: Add support for orientation on Himax HX8347d
Andy Shevchenko [Mon, 3 May 2021 17:21:12 +0000 (20:21 +0300)]
staging: fbtft: Add support for orientation on Himax HX8347d

Himax HX8347d has non-standard register to control orientation.
Add support for different orientation values.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fbtft: Don't spam logs when probe is deferred
Andy Shevchenko [Mon, 3 May 2021 17:21:11 +0000 (20:21 +0300)]
staging: fbtft: Don't spam logs when probe is deferred

When requesting GPIO line the probe can be deferred.
In such case don't spam logs with an error message.
This can be achieved by switching to dev_err_probe().

Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface")
Cc: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: fbtft: Rectify GPIO handling
Andy Shevchenko [Mon, 3 May 2021 17:21:10 +0000 (20:21 +0300)]
staging: fbtft: Rectify GPIO handling

The infamous commit c440eee1a7a1 ("Staging: staging: fbtft: Switch to
the GPIO descriptor interface") broke GPIO handling completely.
It has already four commits to rectify and it seems not enough.
In order to fix the mess here we:

  1) Set default to "inactive" for all requested pins

  2) Fix CS#, RD#, and WR# pins polarity since it's active low
     and GPIO descriptor interface takes it into consideration
     from the Device Tree or ACPI

  3) Consolidate chip activation (CS# assertion) under default
     ->reset() callback

To summarize the expectations about polarity for GPIOs:

   RD# Low
   WR# Low
   CS# Low
   RESET# Low
   DC or RS High
   RW High
   Data 0 .. 15 High

See also Adafruit learning course [1] for the example of the schematics.

While at it, drop unneeded NULL checks, since GPIO API is tolerant to that.

[1]: https://learn.adafruit.com/adafruit-2-8-and-3-2-color-tft-touchscreen-breakout-v2/downloads

Fixes: 92e3e884887c ("Staging: fbtft: Fix GPIO handling")
Fixes: b918d1c27066 ("Staging: fbtft: Fix reset assertion when using gpio descriptor")
Fixes: dbc4f989c878 ("Staging: fbtft: Fix probing of gpio descriptor")
Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface")
Cc: Jan Sebastian Götte <linux@jaseg.net>
Cc: Nishad Kamdar <nishadkamdar@gmail.com>
Reviewed-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove odm_debug.h header file
Fabio Aiuto [Fri, 30 Apr 2021 14:57:05 +0000 (16:57 +0200)]
staging: rtl8723bs: remove odm_debug.h header file

remove obsolete odm_debug.h header file.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/58f3ed0c7706fdb33614d3e38ed802d56d77f0ec.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove DebugLevel member in dm_odm_t struct
Fabio Aiuto [Fri, 30 Apr 2021 14:57:04 +0000 (16:57 +0200)]
staging: rtl8723bs: remove DebugLevel member in dm_odm_t struct

remove DebugLevel in dm_odm_t struct,
remove private debug level tracing.

remove unused variable as well to suppress compiler warning.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/ac4afb00f904511e0cbb23136f8e7a3e204ad7ed.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove member in dm_odm_t struct
Fabio Aiuto [Fri, 30 Apr 2021 14:57:03 +0000 (16:57 +0200)]
staging: rtl8723bs: remove member in dm_odm_t struct

remove DebugComponent in dm_odm_t struct,
remove private debug component tracing.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/313d08514d2105c826ef3c92555fa557def2b9c2.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty hal/odm_debug.c file
Fabio Aiuto [Fri, 30 Apr 2021 14:57:02 +0000 (16:57 +0200)]
staging: rtl8723bs: remove empty hal/odm_debug.c file

remove file left empty after function deletion.
remove related target in Makefile.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0bd6ce2da09a5e2a671dc4a53f1c2e7ba1a64066.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove ODM_InitDebugSetting() function
Fabio Aiuto [Fri, 30 Apr 2021 14:57:01 +0000 (16:57 +0200)]
staging: rtl8723bs: remove ODM_InitDebugSetting() function

remove ODM_InitDebugSetting() function. It was
intended to initialize removed private debug
system. So remove it.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/6a8524b780674d05f33977eb86878d95c7338a1a.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove RT_DISP macro definition
Fabio Aiuto [Fri, 30 Apr 2021 14:57:00 +0000 (16:57 +0200)]
staging: rtl8723bs: remove RT_DISP macro definition

remove unused RT_DISP macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8983c3077979830aec02427ed895507213b38f95.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove commented out *RT_DISP logs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:59 +0000 (16:56 +0200)]
staging: rtl8723bs: remove commented out *RT_DISP logs

remove commented out ODM_RT_DISP and RT_DISP logs.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/23b7764fc40e1b201952be79e94e0782cf33d546.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused DbgPrint macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:58 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused DbgPrint macro

remove unused DbgPrint macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/00e9b407fa1a7c911295b2fec215d82f5da058f8.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove commented out DbgPrint logs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:57 +0000 (16:56 +0200)]
staging: rtl8723bs: remove commented out DbgPrint logs

remove commented out DbgPrint logs.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/63eb0244a9e25d5633d78b67fd5a0c61cb48d83e.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove obsolete debug macros
Fabio Aiuto [Fri, 30 Apr 2021 14:56:56 +0000 (16:56 +0200)]
staging: rtl8723bs: remove obsolete debug macros

remove obsolete debug macros.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a35b084444ca423ba3b8a212c38b974535a7048c.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused enum
Fabio Aiuto [Fri, 30 Apr 2021 14:56:55 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused enum

remove unused enum.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/029a9639ef046e44defc59854d6bb9a86dd3db4f.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove obsolete GLBtcDbgType array declarations
Fabio Aiuto [Fri, 30 Apr 2021 14:56:54 +0000 (16:56 +0200)]
staging: rtl8723bs: remove obsolete GLBtcDbgType array declarations

remove obsolete GLBtcDbgType declarations for it was intended
for private debug facilities.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/000825941048c41cc53a0cc675fae2b45b781aad.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unnecessary halbtcoutsrc_DbgInit() function
Fabio Aiuto [Fri, 30 Apr 2021 14:56:53 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unnecessary halbtcoutsrc_DbgInit() function

halbtcoutsrc_DbgInit() static function was intended for
manual activation of private tracing facilities.

So remove it.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/f6c4f680b2d0ee8850f97532ca76dd405c1d50c3.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove hal_btcoex_GetDBG() function
Fabio Aiuto [Fri, 30 Apr 2021 14:56:52 +0000 (16:56 +0200)]
staging: rtl8723bs: remove hal_btcoex_GetDBG() function

remove unused hal_btcoex_GetDBG() function definition and
prototype.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8b06dc12a65ef15f3e67bd32d097dc4db3f78586.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unsed hal_btcoex_SetDBG() function
Fabio Aiuto [Fri, 30 Apr 2021 14:56:51 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unsed hal_btcoex_SetDBG() function

remove unused hal_btcoex_SetDBG() function definition and
prototype.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/4f8aa4e4312777aff1aea621d26c00e81754025a.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty #ifdef block
Fabio Aiuto [Fri, 30 Apr 2021 14:56:50 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty #ifdef block

remove empty #ifdef block.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/9a2095cfd69647dd304eb9e059a6aa9aa00694e6.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove BTC_PRINT_F macro definition
Fabio Aiuto [Fri, 30 Apr 2021 14:56:49 +0000 (16:56 +0200)]
staging: rtl8723bs: remove BTC_PRINT_F macro definition

remove unused BTC_PRINT_F macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/503423caee1cc2b7a8fe321e0efb546556f2887f.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove BTC_PRINT_DATA definitions
Fabio Aiuto [Fri, 30 Apr 2021 14:56:48 +0000 (16:56 +0200)]
staging: rtl8723bs: remove BTC_PRINT_DATA definitions

remove unused BTC_PRINT_DATA definitions.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0b83b96133af86e73bed64d7fe35ea96b2940208.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove BTC_PRINT_ADDR macro definitions
Fabio Aiuto [Fri, 30 Apr 2021 14:56:47 +0000 (16:56 +0200)]
staging: rtl8723bs: remove BTC_PRINT_ADDR macro definitions

remove unused BTC_PRINT_ADDR macro definitions.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/31af3e56cfd52f2797499d3beb38741bddaff65d.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove BTC_PRINT macro definitions
Fabio Aiuto [Fri, 30 Apr 2021 14:56:46 +0000 (16:56 +0200)]
staging: rtl8723bs: remove BTC_PRINT macro definitions

remove unused BTC_PRINT macro definitions.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0f0129063880553001a2c1d8272d10079abc7132.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove commented out BTC_PRINT logs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:45 +0000 (16:56 +0200)]
staging: rtl8723bs: remove commented out BTC_PRINT logs

remove commented out BTC_PRINT logs.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/dd6ea6b65cb7db15254ac6ab3fbdfcabb7e66a1a.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove braces around single statement in if block
Fabio Aiuto [Fri, 30 Apr 2021 14:56:44 +0000 (16:56 +0200)]
staging: rtl8723bs: remove braces around single statement in if block

fix following post-commit hook checkatch issue:

WARNING: braces {} are not necessary for single statement blocks
21: FILE: drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c:609:
+ if (!bBtHsOn) {
  algorithm =
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
  }

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/1c95d3d0d4ccd74d4e97ee496f7a04eadd1f8ff0.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty if-else blocks after BTC_PRINT removal
Fabio Aiuto [Fri, 30 Apr 2021 14:56:43 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty if-else blocks after BTC_PRINT removal

remove if-else blocks left empty after BTC_PRINT removal.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/102455368fa9535dc78584d7d24cd12ee4160737.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove BTC_PRINT logs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:42 +0000 (16:56 +0200)]
staging: rtl8723bs: remove BTC_PRINT logs

Remove BTC_PRINT logs.

BTC_PRINT macro's default behavoiur is _do nothing_.
It's enabled by uncommenting some code in hal/hal_btcoex.c
file.

So just remove it.

Applied following semantic patch:

@@
@@

- BTC_PRINT(...);

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/9a9a8ce817929f1705b623c470cbafcc75fb3e72.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused RT_PRINTK macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:41 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused RT_PRINTK macro

remove unused RT_PRINTK macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/edf86e39fce8a53f52c8c8463d134ea426f58b60.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove commented out RT_ASSERT occurrences
Fabio Aiuto [Fri, 30 Apr 2021 14:56:40 +0000 (16:56 +0200)]
staging: rtl8723bs: remove commented out RT_ASSERT occurrences

remove commented out obsoete RT_ASSERT macro occurences.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/3ee98d7bf1685af627e625f413de355fce58d52d.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty #ifndef block
Fabio Aiuto [Fri, 30 Apr 2021 14:56:39 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty #ifndef block

remove empty ifndef block.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2caae2efcfbe74cafe6aa000ca7b330cc371dca2.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ASSERT macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:38 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused ASSERT macro

remove unused do nothing ASSERT macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/f13bc57cc3a821c40443dddc38258b87962774a7.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty ifdef block
Fabio Aiuto [Fri, 30 Apr 2021 14:56:37 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty ifdef block

remove empty ifdef block

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e30ccbe6cf20069e1a24a7a150d0b6241a7b57f8.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ODM_dbg_exit macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:36 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused ODM_dbg_exit macro

remove unused ODM_dbg_exit macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/84b76bc814f44e3b2da92318b05f101f59cf0889.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ODM_dbg_enter
Fabio Aiuto [Fri, 30 Apr 2021 14:56:35 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused ODM_dbg_enter

remove unused ODM_dbg_enter macro definition.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/b52f307265b7662bc6a02eac56dec92b3613a58c.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ODM_dbg_trace macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:34 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused ODM_dbg_trace macro

remove unused ODM_dbg_trace macro definitions.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/ed3cc3b2c0df4f3c3f691b353f181f7c22309dbd.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ODM_PRINT_ADDR macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:33 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused ODM_PRINT_ADDR macro

remove unused ODM_PRINT_ADDR macro definitions.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8f04c3b8b841efc4271d4a7ef71a95e04894d64a.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused ODM_RT_ASSERT macro
Fabio Aiuto [Fri, 30 Apr 2021 14:56:32 +0000 (16:56 +0200)]
staging: rtl8723bs: remove unused ODM_RT_ASSERT macro

remove unused ODM_RT_ASSERT macro declarations.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/4d9fd27f60d1ef4bf8384d411885d05c6d40768e.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace ODM_RT_ASSERT with netdev_dbg()
Fabio Aiuto [Fri, 30 Apr 2021 14:56:31 +0000 (16:56 +0200)]
staging: rtl8723bs: replace ODM_RT_ASSERT with netdev_dbg()

replace ODM_RT_ASSERT with netdev dbg.

Marco ODM_RT_ASSERT wraps a raw prink and prints a message
everytime second argument is false. This occurrence prints
always, so replace it with netdev_dbg()

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/3f172aaefb84aaac639f1850c5eb45678578e393.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove all commented out ODM_RT_TRACE logs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:30 +0000 (16:56 +0200)]
staging: rtl8723bs: remove all commented out ODM_RT_TRACE logs

remove all commented out ODM_RT_TRACE logs.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a98ce6637bb15de79997325a78672fc81c48cd6a.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove ODM_RT_TRACE* unused macro defs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:29 +0000 (16:56 +0200)]
staging: rtl8723bs: remove ODM_RT_TRACE* unused macro defs

remove unused ODM_RT_TRACE* macro defs.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/f0feec848702a12594bb67acceb42f4be647088e.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty header file
Fabio Aiuto [Fri, 30 Apr 2021 14:56:28 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty header file

remove empty header file.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/5f38543b96f491cf9a11bb8cda17e5be754a3636.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove undefined function prototypes
Fabio Aiuto [Fri, 30 Apr 2021 14:56:27 +0000 (16:56 +0200)]
staging: rtl8723bs: remove undefined function prototypes

remove undefined function prototypes.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/77c0c9027448be020a00e7ded9ffeb967341b588.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty hal/odm_PathDiv.c source file
Fabio Aiuto [Fri, 30 Apr 2021 14:56:26 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty hal/odm_PathDiv.c source file

remove empty hal/odm_PathDiv.c source file.
remove related target in Makefile.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/90ebcf46a58375ae25d51638ae91fa40521c6c06.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove empty functions
Fabio Aiuto [Fri, 30 Apr 2021 14:56:25 +0000 (16:56 +0200)]
staging: rtl8723bs: remove empty functions

remove functions left empty after ODM_RT_TRACE deletion.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2a0606394fec2cbb32df6ec0bf4b5974416195f6.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove if-else blocks left empty by ODM_RT_TRACE deletion
Fabio Aiuto [Fri, 30 Apr 2021 14:56:24 +0000 (16:56 +0200)]
staging: rtl8723bs: remove if-else blocks left empty by ODM_RT_TRACE deletion

remove if-else blocks left empty by ODM_RT_TRACE deletion.
remove unused variables to suppress compiler warnings.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0e1196ebf56787f62dcbfbcba1fcbc2ed37a65ce.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove ODM_RT_TRACE logs
Fabio Aiuto [Fri, 30 Apr 2021 14:56:23 +0000 (16:56 +0200)]
staging: rtl8723bs: remove ODM_RT_TRACE logs

remove all ODM_RT_TRACE logs.

ODM_RT_TRACE macro default behaviour
is _trace nothing_. To enable it a hand code
edit is needed in hal/odm_debug.c.
So just remove it.

Applied the semantic patch:

@@
@@

- ODM_RT_TRACE(...);

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/23e21c100ba4f0753c6f03a1bb28d9bd7729b64b.1619794331.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: Use list iterators and helpers
Guenter Roeck [Wed, 28 Apr 2021 17:33:01 +0000 (10:33 -0700)]
staging: rtl8723bs: Use list iterators and helpers

The rtl8723bs driver manually re-implements list helper functions
and macros in various ways. Replace with existing list helpers.

The following coccinelle script was used to convert the code.

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
  ... when != e
- while ( \( v1 != e \| e != v1 \) )
+ list_for_each (e, v1)
  {
    ...
-   v2 = container_of(e, struct v3, v4);
+   v2 = list_entry(e, struct v3, v4);
?-  if (!v2) S
    ...
(
-   e = e->next;
|
- e = get_next(e);
)
    ... when != e
  }
...+>

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
  ... when != e
- while (1)
+ list_for_each (e, v1)
  {
- if ( \( e == v1 \| v1 == e \) )
-   break;
    ...
-   v2 = container_of(e, struct v3, v4);
+   v2 = list_entry(e, struct v3, v4);
?-  if (!v2) S
    ...
(
-   e = e->next;
|
- e = get_next(e);
)
    ... when != e
  }
...+>

Manually fixed up formatting, and added auto-removed comments back in.
Compile tested only.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210428173301.149619-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: remove enum WIFI_FRAME_SUBTYPE
Christophe JAILLET [Sun, 2 May 2021 11:30:06 +0000 (13:30 +0200)]
staging: rtl8188eu: remove enum WIFI_FRAME_SUBTYPE

The values defined in enum WIFI_FRAME_SUBTYPE are the same the #define
IEEE80211_STYPE_xxx from <linux/ieee80211.h>.

Special care must be taken for control and data frame, because  the coding
of the frame type is not included in the IEEE80211_STYPE_xxx values and
must be added explicitly.

There is no problem for management frame because the type si coded as (0)
(in rtl8188eu) and (0x0000) (in <linux/ieee80211.h>).

Values used for control frame (WIFI_PSPOLL) must be OR'eded with
IEEE80211_FTYPE_CTL.

Values used for data frame (WIFI_DATA_NULL and WIFI_QOS_DATA_NULL) must be
OR'ed with IEEE80211_FTYPE_DATA.

Use theses values to avoid code duplication.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/7c1007d5706a42e0ba1fe805089fab523f9db7ea.1619953884.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8712: Fix some tests against some 'data' subtype frames
Christophe JAILLET [Sun, 2 May 2021 07:21:08 +0000 (09:21 +0200)]
staging: rtl8712: Fix some tests against some 'data' subtype frames

Commit 6e2baa44c6d1 ("staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE")
was wrong because:
WIFI_DATA_NULL != IEEE80211_STYPE_NULLFUNC
WIFI_DATA_CFACK != IEEE80211_STYPE_DATA_CFACK
WIFI_DATA_CFPOLL != IEEE80211_STYPE_DATA_CFPOLL
WIFI_DATA_CFACKPOLL != IEEE80211_STYPE_DATA_CFACKPOLL

the WIFI_DATA_xxx definitions include WIFI_DATA_TYPE, which is 'BIT(3)'.
Restore the previous behavior by adding the missing
'IEEE80211_FTYPE_DATA |' (0x0008, that is to say BIT(3)) when these values
are used.

Hopefully, the wrong commit was small enough and hand review is possible.

Fixes: 6e2baa44c6d1 ("staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/44aebfa3c5ce8f45ae05369c73e9ff77c6d271f9.1619939806.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: Change the return type
Saurav Girepunje [Wed, 28 Apr 2021 17:55:20 +0000 (23:25 +0530)]
staging: rtl8723bs: Change the return type

Remove the ret variable in rtw_suspend_common() and change
the return type from int to void as rtw_suspend_common()
always return zero unconditionally.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/20210428175520.GA8921@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8712: remove multiple multiple assignments
Alexander Vorwerk [Sat, 1 May 2021 23:45:01 +0000 (01:45 +0200)]
staging: rtl8712: remove multiple multiple assignments

Documentation/process/coding-style.rst says (in line 88)
"Don't put multiple assignments on a single line either."

This patch fixes the coding style issue reported by checkpatch.pl.

Signed-off-by: Alexander Vorwerk <alec@vc-celle.de>
Link: https://lore.kernel.org/r/20210501234501.5411-1-alec@vc-celle.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: replace comparison to NULL by bool
zhaoxiao [Fri, 30 Apr 2021 12:56:57 +0000 (20:56 +0800)]
staging: rtl8192e: replace comparison to NULL by bool

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: zhaoxiao <zhaoxiao@uniontech.com>
Link: https://lore.kernel.org/r/20210430125657.18264-1-zhaoxiao@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: remove unnecesasry ftrace-like logging
zhaoxiao [Fri, 30 Apr 2021 12:28:25 +0000 (20:28 +0800)]
staging: rtl8192e: remove unnecesasry ftrace-like logging

Fixed Check: Remove unnecessary ftrace-like logging by simply deleting
that statement as we have other modes of logging like ftrace.
Reported by checkpatch.

Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
Link: https://lore.kernel.org/r/20210430122826.9899-1-zhaoxiao@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: core: Remove set but unused variable
Fabio M. De Francesco [Fri, 30 Apr 2021 09:53:19 +0000 (11:53 +0200)]
staging: rtl8723bs: core: Remove set but unused variable

Removed set but unused variable. Issue detected by gcc.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210430095319.23226-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: hal: Remove set but unused variables
Fabio M. De Francesco [Fri, 30 Apr 2021 09:53:18 +0000 (11:53 +0200)]
staging: rtl8723bs: hal: Remove set but unused variables

Removed four set but unused variables. Issue detected by gcc.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210430095319.23226-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: core: remove unneeded variable
Saurav Girepunje [Wed, 28 Apr 2021 15:40:11 +0000 (21:10 +0530)]
staging: rtl8723bs: core: remove unneeded variable

Below are the changes:

Remove unneeded variable "u8 *pbuf" from function start_bss_network
argument as this can be get from first argument "padapter"

Remove the struct wlan_bssid_ex *network from createbss_hdl function
as this is only used to pass as second argument to start_bss_network()

Remove the struct mlme_priv *mlmepriv from rtw_ap_restore_network
function as this is only used to pass as second argument
to start_bss_network()

Signed-off-by: Saurav Girepunje <saurav.girepunje@google.com>
Link: https://lore.kernel.org/r/20210428154011.GA5571@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused macro DRIVER_PREFIX
Fabio Aiuto [Wed, 28 Apr 2021 07:28:05 +0000 (09:28 +0200)]
staging: rtl8723bs: remove unused macro DRIVER_PREFIX

remove unused macro DRIVER_PREFIX.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2fac5d7f2334f0a9765f2ddfb31502323e49fce1.1619594707.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unnecessary hex dumps
Fabio Aiuto [Wed, 28 Apr 2021 07:28:04 +0000 (09:28 +0200)]
staging: rtl8723bs: remove unnecessary hex dumps

Remove unnecessary hex dumps in kernel log.

This deletion has been done with the following
semantic patch:

@@
@@

- print_hex_dump_debug(...);

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8bbf5ce17f2d778a67e86cb948395e9ed27478d9.1619594707.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192u: fix typos in comments
Iain Craig [Wed, 28 Apr 2021 14:17:34 +0000 (07:17 -0700)]
staging: rtl8192u: fix typos in comments

correct spelling errors across 8 lines of comments.

Signed-off-by: Iain Craig <coldcity@gmail.com>
Link: https://lore.kernel.org/r/20210428141734.GA2498@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8712: Use list iterators and helpers
Guenter Roeck [Wed, 28 Apr 2021 17:35:23 +0000 (10:35 -0700)]
staging: rtl8712: Use list iterators and helpers

Use existing list iterators and helper functions.

The following coccinelle script was used to convert the code.

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
  ... when != e
- while ( \( v1 != e \| e != v1 \) )
+ list_for_each (e, v1)
  {
    ...
-   v2 = container_of(e, struct v3, v4);
+   v2 = list_entry(e, struct v3, v4);
?-  if (!v2) S
    ...
(
-   e = e->next;
|
- e = get_next(e);
)
    ... when != e
  }
...+>

Compile tested only.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210428173523.149958-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8188eu: Use list iterators and helpers
Guenter Roeck [Wed, 28 Apr 2021 16:35:22 +0000 (09:35 -0700)]
staging: rtl8188eu: Use list iterators and helpers

The rtl8188eu manually re-implements list helper functions
and macros in various ways. Replace with existing list helpers.

The following coccinelle script was used to convert the code.

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
  ... when != e
- while ( \( v1 != e \| e != v1 \) )
+ list_for_each (e, v1)
  {
    ...
-   v2 = container_of(e, struct v3, v4);
+   v2 = list_entry(e, struct v3, v4);
?-  if (!v2) S
    ...
(
-   e = e->next;
|
- e = get_next(e);
)
    ... when != e
  }
...+>

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
  ... when != e
- while (1)
+ list_for_each (e, v1)
  {
- if ( \( e == v1 \| v1 == e \) )
-   break;
    ...
-   v2 = container_of(e, struct v3, v4);
+   v2 = list_entry(e, struct v3, v4);
?-  if (!v2) S
    ...
(
-   e = e->next;
|
- e = get_next(e);
)
    ... when != e
  }
...+>

Manually fixed up formatting, and added autoremoved comments back in.
Compile tested only.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210428163522.129189-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wlan-ng: silence incorrect type in argument 1 (different address spaces)
Ashish Kalra [Sat, 1 May 2021 13:52:41 +0000 (19:22 +0530)]
staging: wlan-ng: silence incorrect type in argument 1 (different address spaces)

Currently p80211knetdev_do_ioctl use type casting to req->data to prevent
sparse warning while calling memdup_user, instead of type casting it here,
its better to change data type for data inside p80211ioctl_req to include
__user.

Signed-off-by: Ashish Kalra <eashishkalra@gmail.com>
Link: https://lore.kernel.org/r/YI1dKdfBKaSh3J8v@ashish-NUC8i5BEH
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>