Commit Graph

1232 Commits

Author SHA1 Message Date
Dmitrii Wolf 9e74999b1a Staging: rtl8192u: ieee80211: remove odd backslash.
This backslash should be deleted - looks like leftover and not needed.

Signed-off-by: Dmitrii Wolf <dev.dragon@bk.ru>
Link: https://lore.kernel.org/r/20210411120301.6549-1-dev.dragon@bk.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-12 11:37:47 +02:00
Colin Ian King f9b9263a25 staging: rtl8192u: Fix potential infinite loop
The for-loop iterates with a u8 loop counter i and compares this
with the loop upper limit of riv->ieee80211->LinkDetectInfo.SlotNum
that is a u16 type. There is a potential infinite loop if SlotNum
is larger than the u8 loop counter. Fix this by making the loop
counter the same type as SlotNum.

Addresses-Coverity: ("Infinite loop")
Fixes: 8fc8598e61 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210407150308.496623-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 17:14:38 +02:00
Vardhan H G 52f8b696b7 staging: rt8192u: change constants to be on right
When comparing a constant with variable, it is recommeneded
to have the constant on the right side of the test.

This patch silences the following checkpatch.pl warning:
 "Comparisons should place the constant on the right side of the test"

Signed-off-by: Vardhan H G <crazylonestar7@gmail.com>
Link: https://lore.kernel.org/r/20210407061749.13460-1-crazylonestar7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:21:44 +02:00
Jiapeng Chong b190d1433a staging: rtl8192u: remove unused variable
Fix the following gcc warning:

drivers/staging/rtl8192u/r8192U_core.c:3419:6: warning: variable
‘reset_status’ set but not used [-Wunused-but-set-variable].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1617775650-42645-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:20:28 +02:00
Bruno Raoult 5005ac4d2f r8192U_wx.c: style: avoid multiple blank lines
fix checkpatch.pl check:

CHECK: Please don't use multiple blank lines
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/2c1f2c668d299ce1895ce97dc7fb9a67d3723e63.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:16 +01:00
Bruno Raoult 8d8b93ee35 r8192U_wx.c: style: Unnecessary parentheses
fix checkpatch.pl check:

CHECK: Unnecessary parentheses around expr
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/f42993e183e1127dcc9fce3f0ed42dd6d795c647.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Bruno Raoult b95dd839d7 r8192U_wx.c: style: braces all arms of statement
fix checkpatch.pl check:

CHECK: braces {} should be used on all arms of this statement
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/adbbb5243dca7998a31a786eef277bd85068c63a.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Bruno Raoult 0c98c5e93b r8192U_wx.c: style: spaces preferred around operators
fix checkpatch.pl check:

CHECK: spaces required around that <op>
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/e7298c14538ad7a58720585d019a70f637e0cdb1.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Bruno Raoult 619ee818fa r8192U_wx.c: style: alignment with open parenthesis
fix checkpatch.pl check:

CHECK: Alignment should match open parenthesis
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/34f4134241f49d1694cbfb9c2185e3ef54284680.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Arnd Bergmann 3eb631e321 staging/rtl8192u: avoid Wempty-body warning
This driver has a few disabled diagnostics, which can probably
just get removed, or might still be helpful:

drivers/staging/rtl8192u/r8192U_core.c: In function 'rtl8192_set_rxconf':
drivers/staging/rtl8192u/r8192U_core.c:767:45: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  767 |                 DMESG("NIC in promisc mode");
      |                                             ^
drivers/staging/rtl8192u/r8192U_core.c: In function 'rtl819xusb_rx_command_packet':
drivers/staging/rtl8192u/r8192U_core.c:883:80: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  883 |                 DMESG("rxcommandpackethandle819xusb: It is a command packet\n");
      |                                                                                ^

Changing the empty macro to no_printk() to shut up the compiler warnings
and add format string checking.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210322103545.704121-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-22 17:05:15 +01:00
zhaoxiao 6574fe5b1e Staging: rtl8192u: fixed a whitespace coding style issue
Removed additional whitespaces in the r8192U_wx.c file.

Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
Link: https://lore.kernel.org/r/20210317033219.621-1-zhaoxiao@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-18 10:20:09 +01:00
zhaoxiao f5e72ea40f staging: rtl8192u: fixed no space coding style issue.
Added space around the binary operator for readability in
r8192U_wx.c file

Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
Link: https://lore.kernel.org/r/20210315061202.10219-1-zhaoxiao@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16 12:36:34 +01:00
Greg Kroah-Hartman b828324bba Merge 5.12-rc3 into staging-next
We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-15 07:52:17 +01:00
Atul Gopinathan 88208fa778 staging: rtl8192u: ieee80211: Remove braces for single line blocks
Remove braces around those `if` and `for` blocks which contain a
single line and therefore fix the Checkpatch warning of the
following type:

"WARNING: braces {} are not necessary for single statement blocks"

Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
Link: https://lore.kernel.org/r/20210310104353.14531-1-atulgopinathan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-12 17:31:28 +01:00
Simone Serra 861cdbdd4d staging: rt8192u: Move constant in comparison to the RHS
Fixes checkpatch warning:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Simone Serra <serrazimone@gmail.com>
Link: https://lore.kernel.org/r/20210223234102.15784-1-serrazimone@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:28 +01:00
Du Cheng e1d3944f41 staging: rtl8192u: remove unnecessary return in r8190_rtl8256.c
remove the unnecessary return at the end of function
phy_set_rf8256_ofdm_tx_power(), reported by scripts/checkpatch.pl.

Signed-off-by: Du Cheng <ducheng2@gmail.com>
Link: https://lore.kernel.org/r/20210219150527.8358-2-ducheng2@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:26 +01:00
Du Cheng 6e03efd2f5 staging: rtl8192u: fix RT_TRACE() in r8190_rtl8256.c
use MACRO __func__ instead of the literal names for RT_TRACE()
in phy_set_rf8256_bandwidth() and phy_rf8256_config_para_file(),
as reported by scripts/checkpatch.pl.

Signed-off-by: Du Cheng <ducheng2@gmail.com>
Link: https://lore.kernel.org/r/20210219150527.8358-1-ducheng2@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:26 +01:00
Dan Carpenter 87107518d7 staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()
We need to cap len at IW_ESSID_MAX_SIZE (32) to avoid memory corruption.
This can be controlled by the user via the ioctl.

Fixes: 5f53d8ca3d ("Staging: add rtl8192SU wireless usb driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/YEHoAWMOSZBUw91F@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:23:30 +01:00
Kumar Kartikeya Dwivedi 81590693e3 staging: rtl8192u: Switch from strlcpy to strscpy
strlcpy is marked as deprecated in Documentation/process/deprecated.rst,
and there is no functional difference when the caller expects truncation
(when not checking the return value). strscpy is relatively better as it
also avoids scanning the whole source string.

This silences the related checkpatch warnings from:
5dbdb2d87c ("checkpatch: prefer strscpy to strlcpy")

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20210131172838.146706-11-memxor@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-04 17:16:07 +01:00
Anirudh Rayabharam 06b0c0dce8 staging: rtl8192u/ieee80211: fix switch case indentation
Make switch and case to be at the same indent. This fixes the
checkpatch error "switch and case should be at the same indent".

Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
Link: https://lore.kernel.org/r/20210131131226.16917-1-mail@anirudhrb.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-31 14:44:24 +01:00
Puranjay Mohan c6c4a17bc3 Staging: rtl8192u: use %s and __func__
Change function's name to %s and __func__ to fix checkpatch.pl errors.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Link: https://lore.kernel.org/r/20210124144328.121688-1-puranjay12@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-26 18:44:55 +01:00
Arnd Bergmann 87bb53b755 staging: rtl819x: select CONFIG_CRC32
Without crc32 support, the drivers fail to link:

ERROR: modpost: "crc32_le" [drivers/staging/rtl8192e/rtllib_crypt_wep.ko] undefined!
ERROR: modpost: "crc32_le" [drivers/staging/rtl8192e/rtllib_crypt_tkip.ko] undefined!
ERROR: modpost: "crc32_le" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210103214034.1995821-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-05 15:27:22 +01:00
Dinghao Liu ec36ae7189 staging: rtl8192u: Add null check in rtl8192_usb_initendpoints
There is an allocation for priv->rx_urb[16] has no null check,
which may lead to a null pointer dereference.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20201226080258.6576-1-dinghao.liu@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28 15:11:18 +01:00
Zhang Qilong 071dc1787a staging: rtl8192u: fix wrong judgement in rtl8192_rx_isr
The 'EPERM' cannot appear in the previous path, we
should use '-EPERM' to check it. For example:

Call trace:
->rtl8192_rx_isr
    ->usb_submit_urb
       ->usb_hcd_submit_urb
           ->rh_urb_enqueue
	       ->rh_queue_status
	           ->usb_hcd_link_urb_to_ep

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201028122648.47959-1-zhangqilong3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06 11:02:53 +01:00
Elena Afanasova 0795f519d1 staging/rtl8192u/ieee80211: remove debugging line
Remove unnecessary debug line from rtl8192u_dot11d_init().

Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
Link: https://lore.kernel.org/r/20201022123545.4530-1-eafanasova@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-26 06:53:10 +01:00
Elena Afanasova e13ff19e7c staging/rtl8192u/ieee80211: use __func__ macro
Replace function names with __func__ macro.
Remove unnecessary characters in error messages.
Reported by checkpatch.pl.

Signed-off-by: Elena Afanasova <eafanasova@gmail.com>
Link: https://lore.kernel.org/r/20201020150823.35734-1-eafanasova@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-26 06:53:10 +01:00
Eric Biggers 23224e4500 mm: remove kzfree() compatibility definition
Commit 453431a549 ("mm, treewide: rename kzfree() to
kfree_sensitive()") renamed kzfree() to kfree_sensitive(),
but it left a compatibility definition of kzfree() to avoid
being too disruptive.

Since then a few more instances of kzfree() have slipped in.

Just get rid of them and remove the compatibility definition
once and for all.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-25 11:39:02 -07:00
Linus Torvalds ade7afe3e6 Staging / IIO driver updates for 5.10-rc1
Here is the large set of staging and IIO driver updates for 5.10-rc1.
 
 Included in here are:
 	- new IIO drivers
 	- new IIO driver frameworks
 	- various IIO driver fixes and updates
 	- IIO device tree conversions to yaml
 	- so many minor staging driver coding style cleanups
 	- most cdev driver moved out of staging
 	- no new drivers added or removed
 
 Full details are in the shortlog.
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCX4g+oQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymAyQCghI58tN/Np3itPlZuc+HYFN7OHH8An1TKzCm1
 bwkfw5qAcHab+R7KQZOA
 =BaXS
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging / IIO driver updates from Greg KH:
 "Here is the large set of staging and IIO driver updates for 5.10-rc1.

  Included in here are:

   - new IIO drivers

   - new IIO driver frameworks

   - various IIO driver fixes and updates

   - IIO device tree conversions to yaml

   - so many minor staging driver coding style cleanups

   - most cdev driver moved out of staging

   - no staging drivers added or removed

  Full details are in the shortlog.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (476 commits)
  staging: comedi: check validity of wMaxPacketSize of usb endpoints found
  staging: wfx: improve robustness of wfx_get_hw_rate()
  staging: wfx: drop unicode characters from strings
  staging: wfx: gpiod_get_value() can return an error
  staging: wfx: increase robustness of hif_generic_confirm()
  staging: wfx: wfx_init_common() returns NULL on error
  staging: wfx: standardize the error when vif does not exist
  staging: wfx: check memory allocation
  staging: wfx: improve error handling of hif_join()
  staging: dpaa2-switch: add a dpaa2_switch prefix to all functions in ethsw.c
  staging: dpaa2-switch: add a dpaa2_switch_ prefix to all functions in ethsw-ethtool.c
  staging: rtl8188eu: Fix long lines
  dt-bindings: staging: wfx: silabs,wfx yaml conversion
  staging: wfx: update copyrights dates
  staging: wfx: fix QoS priority for slow buses
  staging: wfx: fix BA sessions for older firmwares
  staging: wfx: remove remaining code of 'secure link' feature
  staging: wfx: fix handling of MMIC error
  staging: vchiq: Fix list_for_each exit tests
  staging: greybus: use __force when assigning __u8 value to snd_ctl_elem_type_t
  ...
2020-10-15 09:46:23 -07:00
Michael Straube d6628e8cbe staging: rtl8192u: clean up comparsions to NULL
Clean up comparsions to NULL reported by checkpatch.
if (x == NULL) -> if (!x)
if (x != NULL) -> if (x)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200919150823.16923-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-22 09:51:12 +02:00
Michael Straube e7a9c7b516 staging: rtl8192u: correct placement of else if
Move 'else if' to the same line as the closing brace of the
corresponding 'if' to follow kernel coding style.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200919150823.16923-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-22 09:51:11 +02:00
Michael Straube c4309727d4 staging: rtl8192u: clean up blank line style issues
Add missing and remove unnecessary blank lines to clear checkpatch
issues.

CHECK: Please use a blank line after function/struct/union/enum declarations
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200919150823.16923-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-22 09:51:11 +02:00
Allen Pais e24eca1fff staging: rtl8192: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Link: https://lore.kernel.org/r/20200916061939.57976-1-allen.lkml@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-16 13:13:00 +02:00
Ard Biesheuvel c596077848 staging/rtl8192u: switch to RC4 library interface
Switch to the ARC4 library interface, to remove the pointless
dependency on the skcipher API, from which we will hopefully be
able to drop ecb(arc4) skcipher support.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-09-11 14:39:14 +10:00
Christophe JAILLET acac75bb45 staging: rtl8192u: Do not use GFP_KERNEL in atomic context
'rtl8192_irq_rx_tasklet()' is a tasklet initialized in
'rtl8192_init_priv_task()'.
>From this function it is possible to allocate some memory with the
GFP_KERNEL flag, which is not allowed in the atomic context of a tasklet.

Use GFP_ATOMIC instead.

The call chain is:
  rtl8192_irq_rx_tasklet            (in r8192U_core.c)
    --> rtl8192_rx_nomal            (in r8192U_core.c)
      --> ieee80211_rx              (in ieee80211/ieee80211_rx.c)
        --> RxReorderIndicatePacket (in ieee80211/ieee80211_rx.c)

Fixes: 79a5ccd972 ("staging: rtl8192u: fix large frame size compiler warning")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200813173458.758284-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-18 16:07:17 +02:00
Colin Ian King c4283950a9 staging: rtl8192u: fix a dubious looking mask before a shift
Currently the masking of ret with 0xff and followed by a right shift
of 8 bits always leaves a zero result.  It appears the mask of 0xff
is incorrect and should be 0xff00, but I don't have the hardware to
test this. Fix this to mask the upper 8 bits before shifting.

[ Not tested ]

Addresses-Coverity: ("Operands don't affect result")
Fixes: 8fc8598e61 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200716154720.1710252-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-17 12:08:44 +02:00
John Oldman eab439bee0 staging: rtl8192u: Using comparison to true is error prone
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman <john.oldman@polehill.co.uk>
Link: https://lore.kernel.org/r/20200706162240.2770-1-john.oldman@polehill.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10 13:52:46 +02:00
Michael Straube cecc7dca16 staging: rtl8192u: remove copying file
All source and header files have a GPL-2.0 SPDX identifier.
The 'copying' file with the whole GPL text is not needed, delete it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200703122604.12096-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10 13:52:45 +02:00
Michael Straube 056535320b staging: rtl8192u: remove GPL boiler plate text
The SPDX identifier is a legally binding shorthand, which
can be used instead of the full boiler plate text.

The file ieee80211_module.c has a proper SPDX line, so the
GPL boiler plate text is not needed.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200703122604.12096-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-10 13:52:45 +02:00
Pascal Terjan 8da047603b staging: rtl8192u: Merge almost duplicate code
This causes a change in behaviour:
- stats also get updated when reordering, this seems like it should be
  the case but those lines were commented out.
- sub_skb NULL check now happens early in both cases, previously it
  happened only after dereferencing it 12 times, so it may not actually
  be needed.

Signed-off-by: Pascal Terjan <pterjan@google.com>

Link: https://lore.kernel.org/r/20200519150042.199690-1-pterjan@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-19 17:08:50 +02:00
John Oldman 2493c61ed5 staging: rtl8192u: Using comparison to true is error prone
fix below issue reported by checkpatch:

CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman <john.oldman@polehill.co.uk>
Link: https://lore.kernel.org/r/20200516163327.9197-1-john.oldman@polehill.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-19 16:13:40 +02:00
Sam Muhammed fd939d5b77 Staging: rtl8192u: ieee80211: Use netdev_alert().
Replace printk(KERN_ALERT ...) with netdev_alert()
when a network device is available.

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/70e8781cd2a9512cb6b3c42400a10323f3024f3c.1585233434.git.jane.pnx9@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26 16:58:23 +01:00
Sam Muhammed 33677b4890 Staging: rtl8192u: ieee80211: Use netdev_info() with network devices.
netdev_info() should be used instead of printk(KERN_INFO ...)
since it's specific to and preferable for printing messages
for network devices.

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/ce20980cc1947255b8a2de3c1f1364c11c163b9e.1585233434.git.jane.pnx9@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26 16:58:23 +01:00
Sam Muhammed 6a5693361a Staging: rtl8192u: ieee80211: Use netdev_warn() for network devices.
Use netdev_warn() over printk().
netdev_warn() is specific for printing warning
messages for network devices, and preferable
over printk(KERN_WARNING ...).

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/02fe0666cb737a3b0581081c9e7c179bfb820cac.1585233434.git.jane.pnx9@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26 16:58:23 +01:00
Sam Muhammed ea7a10ea01 Staging: rtl8192u: ieee80211: Use netdev_dbg() for debug messages.
Replace printk(KERN_DEBUG ...) with netdev_dbg() across the driver.
since netdev_dbg() is preferable and specific for
printing debug messages for network devices.

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/84dc7e33954509457efce2a35fb293e631845a96.1585233434.git.jane.pnx9@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26 16:58:23 +01:00
R Veera Kumar 4986319004 staging: rtl8192u: ieee80211: Correct a typo in a comment
Correct a single typo in a comment.
Misspelling found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/20200319094043.GA2669@tulip.local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-19 15:09:10 +01:00
Lourdes Pedrajas eac7ac5c73 staging: rtl8192u: r8192U_wx: use netdev_warn() instead of printk()
printk() is deprecated, use netdev_warn() instead, which is a message printing
function specific for network devices.
Issue found by checkpatch.

Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Suggested-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Lourdes Pedrajas <lu@pplo.net>
Link: https://lore.kernel.org/r/20200317165917.6260-1-lu@pplo.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-18 11:12:49 +01:00
Camylla Goncalves Cantanheide a6b65a4525 staging: rtl8192u: Corrects 'Avoid CamelCase' for variables
The variables of function setKey triggered a 'Avoid CamelCase'
warning from checkpatch.pl. This patch renames these
variables to correct this warning.

Signed-off-by: Camylla Goncalves Cantanheide <c.cantanheide@gmail.com>
Link: https://lore.kernel.org/r/20200317085130.21213-2-c.cantanheide@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17 12:50:40 +01:00
Camylla Goncalves Cantanheide b85791ce08 staging: rtl8192u: Using function name as string
Solves the following checkpatch.pl for a triggered function:
WARNING: Prefer using '"%s...", __func__' to using 'setKey',
this function's name, in a string

Signed-off-by: Camylla Goncalves Cantanheide <c.cantanheide@gmail.com>
Link: https://lore.kernel.org/r/20200317085130.21213-1-c.cantanheide@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17 12:50:40 +01:00
Camylla Goncalves Cantanheide 14ecf42b12 staging: rtl8192u: Replaces symbolic permissions with octal permissions
Solves following checkpatch.pl issue:
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider
using octal permissions '0444'.

Signed-off-by: Camylla Goncalves Cantanheide <c.cantanheide@gmail.com>
Link: https://lore.kernel.org/r/20200317071959.556-1-c.cantanheide@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17 12:50:40 +01:00
Gustavo A. R. Silva 5979afa2c4 staging: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Link: https://lore.kernel.org/r/20200220132908.GA30501@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23 19:18:54 +01:00