platform/kernel/linux-rpi.git
2 years agostaging: r8188eu: clean up the usb_readXY functions
Martin Kaiser [Sat, 21 Aug 2021 16:48:55 +0000 (18:48 +0200)]
staging: r8188eu: clean up the usb_readXY functions

Remove unnecessary variables, summarize declarations and assignments.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove an unused enum
Martin Kaiser [Sat, 21 Aug 2021 16:48:54 +0000 (18:48 +0200)]
staging: r8188eu: remove an unused enum

The VENDOR_READ and VENDOR_WRITE defines are not used.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rewrite usb vendor request defines
Martin Kaiser [Sat, 21 Aug 2021 16:48:53 +0000 (18:48 +0200)]
staging: r8188eu: rewrite usb vendor request defines

Replace the numeric values with USB constants to make their
meaning clearer.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8188eu: use actual request type as parameter
Martin Kaiser [Sat, 21 Aug 2021 16:48:52 +0000 (18:48 +0200)]
staging: rtl8188eu: use actual request type as parameter

At the moment, usbctrl_vendorreq's requesttype parameter must be set to
1 for reading and 0 for writing. It's then converted to the actual
bmRequestType for the USB control request. We can simplify the code and
avoid this conversion if the caller passes the actual bmRequestType.

This patch is an adaptation of commit 788fde031027 ("staging: rtl8188eu:
use actual request type as parameter") for the new r8188eu driver.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused define
Martin Kaiser [Sat, 21 Aug 2021 16:48:51 +0000 (18:48 +0200)]
staging: r8188eu: remove unused define

_HCI_OPS_OS_C_ is not used in the r8188eu driver. Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary cast
Martin Kaiser [Sat, 21 Aug 2021 16:48:50 +0000 (18:48 +0200)]
staging: r8188eu: remove unnecessary cast

name is a const char * by default. This type should be ok for r8188eu.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove header file ethernet.h
Michael Straube [Wed, 25 Aug 2021 10:08:42 +0000 (12:08 +0200)]
staging: rtl8723bs: remove header file ethernet.h

The header file ehternet.h defines only two constants.

#define ETHERNET_HEADER_SIZE   14          /*  Ethernet Header Length */
#define LLC_HEADER_SIZE         6          /*  LLC Header Length */

Both are only used in the file core/rtw_recv.c and ETHERNET_HEADER_SIZE
just duplicates the in-kernel constant ETH_HLEN. Replace the usage of
ETHERNET_HEADER_SIZE with ETH_HLEN, move the definition of LLC_HEADER_SIZE
into rtw_rev.h (renamed to LLC_HEADER_LENGTH) and remove the now unused
header file ethernet.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210825100842.13217-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging/rtl8192u: Prefer kcalloc over open coded arithmetic
Len Baker [Tue, 24 Aug 2021 09:00:39 +0000 (11:00 +0200)]
staging/rtl8192u: Prefer kcalloc over open coded arithmetic

As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

In this case these aren't actually dynamic sizes: both sides of the
multiplication are constant values. However it is best to refactor these
anyway, just to keep the open-coded math idiom out of code.

So, use the purpose specific kcalloc() function instead of the argument
size * count in the kzalloc() function.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210824090039.GA7999@titan
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging/rtl8192u: Initialize variables in the definition block
Len Baker [Tue, 24 Aug 2021 08:59:58 +0000 (10:59 +0200)]
staging/rtl8192u: Initialize variables in the definition block

Initialize the pre_cmd_cnt, post_cmd_cnt and rf_cmd_cnt variables in the
definition block as it is not necessary to do this in the middle of the
function.

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210824073643.GA7396@titan
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging/rtl8192u: Avoid CamelCase in names of variables
Len Baker [Tue, 24 Aug 2021 07:25:43 +0000 (09:25 +0200)]
staging/rtl8192u: Avoid CamelCase in names of variables

Avoid CameCase in the names of all local variables inside the function
rtl8192_phy_SwChnlStepByStep().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210824072545.7321-2-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused rtw_set_802_11_bssid() function
Fabio Aiuto [Mon, 23 Aug 2021 14:12:03 +0000 (16:12 +0200)]
staging: rtl8723bs: remove unused rtw_set_802_11_bssid() function

remove rtw_set_802_11_bssid() function left unused
after wext routines removal.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/b3d1756b6ae4be7ca4fc50e12bd7e10587a6020c.1629727333.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove functions notifying wext events
Fabio Aiuto [Mon, 23 Aug 2021 14:12:02 +0000 (16:12 +0200)]
staging: rtl8723bs: remove functions notifying wext events

remove functions that once were meant to notify
wext events to userspace. Now they are donig nothing
useful so just remove them.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0d745350ff3d411dda329b8c1e2261361570db6e.1629727333.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: fix logical continuation issue
Fabio Aiuto [Mon, 23 Aug 2021 14:12:01 +0000 (16:12 +0200)]
staging: rtl8723bs: fix logical continuation issue

fix the following post-commit hook checkpatch issue:

CHECK: Logical continuations should be on the previous line
52: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389:
+ if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_
+ || padapter->securitypriv.dot11PrivacyAlgrthm
== _TKIP_WTMIC_

CHECK: Logical continuations should be on the previous line
53: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390:
+ || padapter->securitypriv.dot11PrivacyAlgrthm
== _TKIP_WTMIC_
+ || padapter->securitypriv.dot11PrivacyAlgrthm
== _AES_)

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/5d4e7ab18005e69e8cc162619149d6fa93568875.1629727333.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: fix code indent issues
Fabio Aiuto [Mon, 23 Aug 2021 14:12:00 +0000 (16:12 +0200)]
staging: rtl8723bs: fix code indent issues

fix the following post commit hook checkpatch issues:

ERROR: code indent should use tabs where possible
2463: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:388:
+        if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_$

ERROR: code indent should use tabs where possible
2464: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389:
+                || padapter->securitypriv.dot11PrivacyAlgrthm
== _TKIP_WTMIC_$

ERROR: code indent should use tabs where possible
2465: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390:
+                || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)$

ERROR: code indent should use tabs where possible
2466: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:391:
+                /* WPS open need to enable multicast */$

ERROR: code indent should use tabs where possible
2467: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:392:
+                /*  check_fwstate(&padapter->mlmepriv,
WIFI_UNDER_WPS) == true) */$

ERROR: code indent should use tabs where possible
2468: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:393:
+                rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM,
null_addr);$

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/aa394052c8d81b4a00356adf5f98fc3c81f8b1d9.1629727333.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove obsolete wext support
Fabio Aiuto [Mon, 23 Aug 2021 14:11:59 +0000 (16:11 +0200)]
staging: rtl8723bs: remove obsolete wext support

cfg80211 has been fully implemented so
remove all wext and wext private handlers and their
registration.

Now wext userspace calls can be managed via
cfg80211 wext compatibility.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/61c4bb20bbb6ce30e4ddd01aa73de3f686a99445.1629727333.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: mt7621-pci: fix hang when nothing is connected to pcie ports
Sergio Paracuellos [Mon, 23 Aug 2021 17:08:03 +0000 (19:08 +0200)]
staging: mt7621-pci: fix hang when nothing is connected to pcie ports

When nothing is connected to pcie ports, each port is set to reset state.
When this occurs, next access result in a hang on boot as follows:

mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)
mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
[ HANGS HERE ]

Fix this just detecting 'nothing is connected state' to avoid next accesses
to pcie port related configuration registers.

Fixes: b99cc3a2b6b6 ("staging: mt7621-pci: avoid custom 'map_irq' function")
Cc: stable <stable@vger.kernel.org>
Reported-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210823170803.2108-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function rtw_remove_bcn_ie()
Michael Straube [Thu, 19 Aug 2021 11:22:00 +0000 (13:22 +0200)]
staging: r8188eu: remove unused function rtw_remove_bcn_ie()

Function rtw_remove_bcn_ie() is not used anywhere, remove it.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819112200.32030-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function rtw_add_bcn_ie()
Michael Straube [Thu, 19 Aug 2021 11:21:59 +0000 (13:21 +0200)]
staging: r8188eu: remove unused function rtw_add_bcn_ie()

Function rtw_add_bcn_ie() is not used anywhere, remove it.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819112200.32030-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unneeded semicolon
Yang Li [Fri, 20 Aug 2021 09:08:25 +0000 (17:08 +0800)]
staging: r8188eu: remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c:73:66-67: Unneeded
semicolon
./drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:2225:68-69: Unneeded
semicolon
./drivers/staging/r8188eu/core/rtw_xmit.c:615:75-76: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1629450505-28247-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wlan-ng: Avoid duplicate header in tx/rx frames
Kees Cook [Thu, 19 Aug 2021 17:45:37 +0000 (10:45 -0700)]
staging: wlan-ng: Avoid duplicate header in tx/rx frames

Instead of open-coding the same header details in the tx/rx frames,
directly include the actual struct. Rename associated variables to the
more verbose of the two versions. This also has the benefit of being
able to replace a field-spanning memcpy() with a direct assignment,
helping clear the way for coming FORTIFY_SOURCE improvements.

"diffoscope" reports no object code differences after this change,
excepting the selection of different registers when switching from
memcpy() to direct assignment:

 --- drivers/staging/wlan-ng/prism2usb.o.before
 +++ drivers/staging/wlan-ng/prism2usb.o.after
├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {}
│ @@ -4887,24 +4887,24 @@
│       sub    %rdi,%rcx
│       add    $0x3c,%ecx
│       shr    $0x3,%ecx
│       rep stos %rax,%es:(%rdi)
│       mov    $0x8,%eax
│       movl   $0x123,0x23e(%rbx)
│       mov    %ax,0x244(%rbx)
│ -     mov    (%rdx),%rcx
│ -     mov    %rcx,0x246(%rbx)
│ -     mov    0x8(%rdx),%rcx
│ -     mov    %rcx,0x24e(%rbx)
│ -     mov    0x10(%rdx),%rcx
│ -     mov    %rcx,0x256(%rbx)
│ -     mov    0x18(%rdx),%ecx
│ -     mov    %ecx,0x25e(%rbx)
│ -     movzwl 0x1c(%rdx),%edx
│ -     mov    %dx,0x262(%rbx)
│ +     mov    (%rdx),%rax
│ +     mov    %rax,0x246(%rbx)
│ +     mov    0x8(%rdx),%rax
│ +     mov    %rax,0x24e(%rbx)
│ +     mov    0x10(%rdx),%rax
│ +     mov    %rax,0x256(%rbx)
│ +     mov    0x18(%rdx),%eax
│ +     mov    %eax,0x25e(%rbx)
│ +     movzwl 0x1c(%rdx),%eax
│ +     mov    %ax,0x262(%rbx)
│       cmpq   $0x0,0x0(%rbp)
│       movzwl 0x70(%rsi),%eax
│       je     477a <hfa384x_drvr_txframe+0xba>
│       add    $0x8,%eax
│       mov    $0x44,%r12d
│       mov    %ax,0x264(%rbx)
│       mov    0x70(%r13),%edx

Cc: Romain Perier <romain.perier@gmail.com>
Cc: Allen Pais <apais@linux.microsoft.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210819174537.3499227-3-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wlan-ng: Remove pointless a3/a4 union
Kees Cook [Thu, 19 Aug 2021 17:45:36 +0000 (10:45 -0700)]
staging: wlan-ng: Remove pointless a3/a4 union

There is no need for the a3/a4 union. The two structs are identical
except for the addition of a4. Excepting one place, the structs are
only ever used in the union, and the union is always allocated at full
size. The one instance of the a3-specific struct can be replaced with
the full version, as no sizing information is used. Replace the union
with the a4 version of the struct. "diffoscope" reports there are no
object code differences after this change.

Cc: Allen Pais <apais@linux.microsoft.com>
Cc: Romain Perier <romain.perier@gmail.com>
Cc: Chen Lin <chen.lin5@zte.com.cn>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210819174537.3499227-2-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use GFP_ATOMIC under spinlock
Michael Straube [Thu, 19 Aug 2021 15:29:14 +0000 (17:29 +0200)]
staging: r8188eu: use GFP_ATOMIC under spinlock

kmalloc() in function update_bcn_wps_ie() is called under a spinlock
so the allocation have to be atomic.

-> update_beacon() <- takes a spinlock
   -> update_bcn_vendor_spec_ie()
      -> update_bcn_wps_ie()

Fixes: 79f712ea994de ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()")
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819152914.17482-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: fix scheduling while atomic bugs
Michael Straube [Thu, 19 Aug 2021 09:24:23 +0000 (11:24 +0200)]
staging: r8188eu: fix scheduling while atomic bugs

These allocations are sometimes done under a spin lock so they
have to be atomic. The function call tree is:

-> update_beacon() <- takes a spin lock
   -> update_BCNTIM()
      -> set_tx_beacon_cmd()

Fixes: 79f712ea994de ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()")
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819092423.4349-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove empty rtw_mfree_xmit_priv_lock()
Fabio M. De Francesco [Thu, 19 Aug 2021 05:08:08 +0000 (07:08 +0200)]
staging: r8188eu: Remove empty rtw_mfree_xmit_priv_lock()

Remove rtw_mfree_xmit_priv_lock() because it is empty. Remove its only
call from within _rtw_free_xmit_priv().

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210819050808.28825-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_update_mem_stat macro and associated flags
Phillip Potter [Wed, 18 Aug 2021 23:48:53 +0000 (00:48 +0100)]
staging: r8188eu: remove rtw_update_mem_stat macro and associated flags

Remove the unused rtw_update_mem_stat macro and the associated flags
from include/osdep_service.h as this is all dead code.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove function _rtw_zvmalloc
Phillip Potter [Wed, 18 Aug 2021 23:48:52 +0000 (00:48 +0100)]
staging: r8188eu: remove function _rtw_zvmalloc

Remove the function _rtw_zvmalloc from os_dep/osdep_service.c, as this
function is now unused and is just an inline wrapper around vmalloc
which zeroes out the memory. All previous callers have been converted to
use vzalloc. Also remove the declaration from include/osdep_service.h.

It is considered generally bad practice to declare functions as inline in
the majority of cases, as not only can this qualifier be ignored by the
compiler but the compiler generally makes good decisions about inlining
anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_zvmalloc preprocessor definition
Phillip Potter [Wed, 18 Aug 2021 23:48:51 +0000 (00:48 +0100)]
staging: r8188eu: remove rtw_zvmalloc preprocessor definition

Remove rtw_zvmalloc preprocessor definition from include/osdep_service.h
as it now has no callers.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert all rtw_zvmalloc calls to vzalloc calls
Phillip Potter [Wed, 18 Aug 2021 23:48:50 +0000 (00:48 +0100)]
staging: r8188eu: convert all rtw_zvmalloc calls to vzalloc calls

Convert all rtw_zvmalloc calls within the driver to use the existing
kernel vzalloc function, which has the same semantics. Also rewrite the
two places where it is mentioned in comments to say vzalloc, and remove
the redundant cast to struct adapter * in ./os_dep/usb_intf.c as vzalloc
returns void *.

The reason for the conversion is that rtw_zvmalloc is just a
preprocessor definition for _rtw_zvmalloc which itself is just an inline
wrapper around vmalloc which then zeroes the memory out. As vzalloc does
the same thing via usage of __GFP_ZERO, this code is redundant and can
subsequently be removed.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove function _rtw_vmalloc
Phillip Potter [Wed, 18 Aug 2021 23:48:49 +0000 (00:48 +0100)]
staging: r8188eu: remove function _rtw_vmalloc

Remove the function _rtw_vmalloc from os_dep/osdep_service.c, converting
its only user (also in os_dep/osdep_service.c) to use plain vmalloc.
This function is just an inline wrapper around vmalloc which returns a u8
pointer, which isn't needed. Also remove the declaration from
include/osdep_service.h.

It is considered generally bad practice to declare functions as inline in
the majority of cases, as not only can this qualifier be ignored by the
compiler but the compiler generally makes good decisions about inlining
anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_vmalloc preprocessor definition
Phillip Potter [Wed, 18 Aug 2021 23:48:48 +0000 (00:48 +0100)]
staging: r8188eu: remove rtw_vmalloc preprocessor definition

Remove rtw_vmalloc preprocessor definition from include/osdep_service.h
as it now has no callers.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert only rtw_vmalloc call to vmalloc
Phillip Potter [Wed, 18 Aug 2021 23:48:47 +0000 (00:48 +0100)]
staging: r8188eu: convert only rtw_vmalloc call to vmalloc

Convert the only call to rtw_vmalloc in os_dep/ioctl_linux.c to the
kernel's existing vmalloc function, as rtw_malloc is just a preprocessor
definition for _rtw_vmalloc. The _rtw_vmalloc function is defined inline
and returns a u8, wrapping standard vmalloc. This behaviour is not necessary.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove free_xmit_priv field from struct hal_ops
Phillip Potter [Wed, 18 Aug 2021 23:42:53 +0000 (00:42 +0100)]
staging: r8188eu: remove free_xmit_priv field from struct hal_ops

Remove free_xmit_priv function pointer field from struct hal_ops definition
in include/hal_intf.h, as it is now no longer used anywhere in the driver.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234253.208271-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove function rtw_hal_free_xmit_priv
Phillip Potter [Wed, 18 Aug 2021 23:42:52 +0000 (00:42 +0100)]
staging: r8188eu: remove function rtw_hal_free_xmit_priv

Remove function rtw_hal_free_xmit_priv in hal/hal_intf.c and its
declaration in include/hal_intf.h, as well as the single call line in
core/rtw_xmit.c. This function now essentially checks a function
pointer which will always be NULL (due to previous patches) and
therefore will never be called.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234253.208271-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty function rtl8188eu_free_xmit_priv
Phillip Potter [Wed, 18 Aug 2021 23:42:51 +0000 (00:42 +0100)]
staging: r8188eu: remove empty function rtl8188eu_free_xmit_priv

Remove empty function rtl8188eu_free_xmit_priv from hal/rtl8188eu_xmit.c
and its declaration from include/rtl8188e_xmit.h, as well as the one
place where it is stored in the free_xmit_priv function pointer of the
HalFunc struct inside padapter. This is safe, as the wrapper function
checks for NULL before calling this function via the function pointer.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234253.208271-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macros
Phillip Potter [Wed, 18 Aug 2021 23:42:50 +0000 (00:42 +0100)]
staging: r8188eu: remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macros

Remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macro definitions from
include/rtl8188e_xmit.h, as these were only called from the now removed
dump_txrpt_ccx_88e function, which was itself not called from anywhere
anyway.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234253.208271-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function dump_txrpt_ccx_88e
Phillip Potter [Wed, 18 Aug 2021 23:42:49 +0000 (00:42 +0100)]
staging: r8188eu: remove unused function dump_txrpt_ccx_88e

Remove unused function dump_txrpt_ccx_88e from hal/rtl8188e_xmit.c and
remove its declaration in include/rtl8188e_xmit.h, as this function is
not called from anywhere, and is thus dead code.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234253.208271-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove _dbg_dump_tx_info function
Phillip Potter [Wed, 18 Aug 2021 23:42:48 +0000 (00:42 +0100)]
staging: r8188eu: remove _dbg_dump_tx_info function

Remove _dbg_dump_tx_info from hal/rtl8188e_xmit.c as it is just a
dumping function that contains a lot of unclear DBG_88E calls, and has
no other external effect, other than calling a function that ultimately
determines whether or not to dump/trigger the DBG_88E calls. Also remove
its declaration and single call site.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234253.208271-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Wed, 18 Aug 2021 22:14:18 +0000 (17:14 -0500)]
staging: r8188eu: Fix fall-through warnings for Clang

Fix the following fallthrough warnings:

drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

This helps with the ongoing efforts to globally enable
-Wimplicit-fallthrough for Clang.

Link: https://github.com/KSPP/linux/issues/115
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210818221418.GA311735@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename variable within rtl8188e_Add_RateATid
Phillip Potter [Wed, 18 Aug 2021 18:08:31 +0000 (19:08 +0100)]
staging: r8188eu: rename variable within rtl8188e_Add_RateATid

Rename 'shortGIrate' within the rtl8188e_Add_RateATid function to
'short_gi_rate', to comply with kernel camel case style rules.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818180831.67581-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ctrl vendor req index is not used
Martin Kaiser [Wed, 18 Aug 2021 20:00:41 +0000 (22:00 +0200)]
staging: r8188eu: ctrl vendor req index is not used

The index for r8188eu's vendor-specific control requests is not used.
Remove the index parameter from usbctrl_vendorreq and pass index 0 to
usb_control_msg.

This patch is an adaptation of commit 3d0be94f62fd ("staging: rtl8188eu:
ctrl vendor req index is not used") for the new r8188eu driver.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210818200041.10870-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ctrl vendor req value is always 0x05
Martin Kaiser [Wed, 18 Aug 2021 20:00:40 +0000 (22:00 +0200)]
staging: r8188eu: ctrl vendor req value is always 0x05

The bRequest value for the vendor specific control requests sent by this
driver is always 0x05. Replace the function parameter with the define from
usb_ops.h.

This patch is an adaptation of commit eeb4661560ff ("staging: rtl8188eu:
ctrl vendor req value is always 0x05") for the new r8188eu driver.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210818200041.10870-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up comparsions to false
Michael Straube [Wed, 18 Aug 2021 08:08:54 +0000 (10:08 +0200)]
staging: r8188eu: clean up comparsions to false

Clean up comparsions to false.

x == false -> !x

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210818080854.15847-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up comparsions to true
Michael Straube [Wed, 18 Aug 2021 08:08:53 +0000 (10:08 +0200)]
staging: r8188eu: clean up comparsions to true

Clean up comparsions to true.

x == true -> x

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210818080854.15847-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove null pointer checks before kfree
Michael Straube [Wed, 18 Aug 2021 08:58:09 +0000 (10:58 +0200)]
staging: r8188eu: remove null pointer checks before kfree

kfree(NULL) is safe, so remove unnecessary null pointer checks before
calls to kfree. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210818085809.31451-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove unused including <linux/version.h>
Cai Huoqing [Wed, 18 Aug 2021 09:53:31 +0000 (17:53 +0800)]
staging: r8188eu: Remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210818095331.3422-1-caihuoqing@baidu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wlan-ng: Disable buggy MIB ioctl
Kees Cook [Wed, 18 Aug 2021 08:19:37 +0000 (01:19 -0700)]
staging: wlan-ng: Disable buggy MIB ioctl

struct hfa384x_wpa_data ends with a flexible array, but it is allocated
on the stack. This means it can never hold any data. Disable the
memcpy() calls in and out of the structure, since it must always be
zero. This could never have worked.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210818081937.1668775-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rts5208: Fix get_ms_information() heap buffer size
Kees Cook [Wed, 18 Aug 2021 04:42:52 +0000 (21:42 -0700)]
staging: rts5208: Fix get_ms_information() heap buffer size

Fix buf allocation size (it needs to be 2 bytes larger). Found when
__alloc_size() annotations were added to kmalloc() interfaces.

In file included from ./include/linux/string.h:253,
                 from ./include/linux/bitmap.h:10,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/paravirt.h:17,
                 from ./arch/x86/include/asm/irqflags.h:63,
                 from ./include/linux/irqflags.h:16,
                 from ./include/linux/rcupdate.h:26,
                 from ./include/linux/rculist.h:11,
                 from ./include/linux/pid.h:5,
                 from ./include/linux/sched.h:14,
                 from ./include/linux/blkdev.h:5,
                 from drivers/staging/rts5208/rtsx_scsi.c:12:
In function 'get_ms_information',
    inlined from 'ms_sp_cmnd' at drivers/staging/rts5208/rtsx_scsi.c:2877:12,
    inlined from 'rtsx_scsi_handler' at drivers/staging/rts5208/rtsx_scsi.c:3247:12:
./include/linux/fortify-string.h:54:29: warning: '__builtin_memcpy' forming offset [106, 107] is out
 of the bounds [0, 106] [-Warray-bounds]
   54 | #define __underlying_memcpy __builtin_memcpy
      |                             ^
./include/linux/fortify-string.h:417:2: note: in expansion of macro '__underlying_memcpy'
  417 |  __underlying_##op(p, q, __fortify_size);   \
      |  ^~~~~~~~~~~~~
./include/linux/fortify-string.h:463:26: note: in expansion of macro '__fortify_memcpy_chk'
  463 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,   \
      |                          ^~~~~~~~~~~~~~~~~~~~
drivers/staging/rts5208/rtsx_scsi.c:2851:3: note: in expansion of macro 'memcpy'
 2851 |   memcpy(buf + i, ms_card->raw_sys_info, 96);
      |   ^~~~~~

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210818044252.1533634-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove code depending on NAT25_LOOKUP
Fabio M. De Francesco [Tue, 17 Aug 2021 18:57:23 +0000 (20:57 +0200)]
staging: r8188eu: Remove code depending on NAT25_LOOKUP

Remove all the code related to the management of the NAT25_LOOKUP
method in nat25_db_handle(). The only function that used that method was
the now deleted nat25_handle_frame(). Remove the NAT25_LOOKUP entry from
the NAT25_METHOD enum because it is not anymore used everywhere else in
the code of the driver.

Remove the 'sender' pointer to integer. Remove
__nat25_db_network_lookup_and_replace(). Following the deletion of the
code related to the NAT25_LOOKUP method, they are no more needed.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210817185723.15192-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoclk: staging: correct reference to config IOMEM to config HAS_IOMEM
Lukas Bulwahn [Tue, 17 Aug 2021 10:54:04 +0000 (12:54 +0200)]
clk: staging: correct reference to config IOMEM to config HAS_IOMEM

Commit 0a0a66c984b3 ("clk: staging: Specify IOMEM dependency for Xilinx
Clocking Wizard driver") introduces a dependency on the non-existing config
IOMEM, which basically makes it impossible to include this driver into any
build. Fortunately, ./scripts/checkkconfigsymbols.py warns:

IOMEM
Referencing files: drivers/staging/clocking-wizard/Kconfig

The config for IOMEM support is called HAS_IOMEM. Correct this reference to
the intended config.

Fixes: 0a0a66c984b3 ("clk: staging: Specify IOMEM dependency for Xilinx Clocking Wizard driver")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20210817105404.13146-1-lukas.bulwahn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unneeded DBG_88E call from rtl8188e_Add_RateATid
Phillip Potter [Mon, 16 Aug 2021 23:44:58 +0000 (00:44 +0100)]
staging: r8188eu: remove unneeded DBG_88E call from rtl8188e_Add_RateATid

Remove unneeded DBG_88E macro call from the rtl8188e_Add_RateATid
function in hal/rtl8188e_cmd.c, as it is not particularly clear in my
opinion, and we should strive towards use of existing kernel machinery
for debugging purposes.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210816234459.132239-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove set but unused variable from rtl8188e_Add_RateATid
Phillip Potter [Mon, 16 Aug 2021 23:44:57 +0000 (00:44 +0100)]
staging: r8188eu: remove set but unused variable from rtl8188e_Add_RateATid

Remove set but unused variable init_rate from the rtl8188e_Add_RateATid
function in hal/rtl8188eu_cmd.c, as this fixes a kernel test robot
warning. Removing the call to get_highest_rate_idx has no side effects
here so is safe.

Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210816234459.132239-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in os_dep dir
Michael Straube [Mon, 16 Aug 2021 21:10:53 +0000 (23:10 +0200)]
staging: r8188eu: clean up spacing style issues in os_dep dir

Clean up spacing style issues reported by checkpatch in the os_dep
directory.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited before semicolon
WARNING: space prohibited between function name and open parenthesis '('
ERROR: spaces required around that '=' (ctx:VxV)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816211053.31728-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in hal dir, part 3
Michael Straube [Mon, 16 Aug 2021 20:55:11 +0000 (22:55 +0200)]
staging: r8188eu: clean up spacing style issues in hal dir, part 3

Clean up spacing style issues reported by checkpatch in the remaining
files in the hal directory.

CHECK: spaces preferred around that ...

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816205511.20068-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in hal dir, part 2
Michael Straube [Mon, 16 Aug 2021 20:55:10 +0000 (22:55 +0200)]
staging: r8188eu: clean up spacing style issues in hal dir, part 2

Clean up spacing style issues reported by checkpatch in the next 10
files in the hal directory.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited before semicolon
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816205511.20068-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in hal dir, part 1
Michael Straube [Mon, 16 Aug 2021 20:55:09 +0000 (22:55 +0200)]
staging: r8188eu: clean up spacing style issues in hal dir, part 1

Clean up spacing style issues reported by checkpatch in the first 10
files in the hal directory.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816205511.20068-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_sta_mgt.c
Michael Straube [Mon, 16 Aug 2021 15:58:17 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_sta_mgt.c

Clean up spacing style issues in core/rtw_sta_mgt.c reported by
checkpatch.

WARNING: space prohibited between function name and open parenthesis '('
CHECK: spaces preferred around that '/' (ctx:VxV)
WARNING: space prohibited before semicolon

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-23-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add space around operator in core/rtw_sreset.c
Michael Straube [Mon, 16 Aug 2021 15:58:16 +0000 (17:58 +0200)]
staging: r8188eu: add space around operator in core/rtw_sreset.c

Add missing space around operator in core/rtw_sreset.c reported by
checkpatch.

CHECK: spaces preferred around that '|' (ctx:VxV)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-22-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_debug.c
Michael Straube [Mon, 16 Aug 2021 15:58:15 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_debug.c

Clean up spacing style issues in core/rtw_debug.c reported by checkpatch.

CHECK: spaces preferred around that '%' (ctx:VxV)
WARNING: space prohibited before semicolon

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-21-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_xmit.c
Michael Straube [Mon, 16 Aug 2021 15:58:14 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_xmit.c

Clean up spacing style issues in core/rtw_xmit.c reported by checkpatch.

CHECK: spaces preferred around that ...
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-20-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add spaces around operators in core/rtw_wlan_util.c
Michael Straube [Mon, 16 Aug 2021 15:58:13 +0000 (17:58 +0200)]
staging: r8188eu: add spaces around operators in core/rtw_wlan_util.c

Add missung spaces around operators in core/rtw_wlan_util.c reported
by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-19-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_security.c
Michael Straube [Mon, 16 Aug 2021 15:58:12 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_security.c

Clean up spacing style issues in core/rtw_security.c reported by
checkpatch.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited before semicolon

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-18-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_recv.c
Michael Straube [Mon, 16 Aug 2021 15:58:11 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_recv.c

Clean up spacing style issues in core/rtw_recv.c reported by checkpatch.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-17-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_pwrctrl.c
Michael Straube [Mon, 16 Aug 2021 15:58:10 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_pwrctrl.c

Clean up spacing style issues in core/rtw_pwrctrl.c reported by
checkpatch.

CHECK: spaces preferred around that ...
WARNING: space prohibited before semicolon

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-16-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_p2p.c
Michael Straube [Mon, 16 Aug 2021 15:58:09 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_p2p.c

Clean up spacing style issues in core/rtw_p2p.c reported by checkpatch.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited before semicolon
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-15-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_mp_ioctl.c
Michael Straube [Mon, 16 Aug 2021 15:58:08 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_mp_ioctl.c

Clean up spacing style issues in core/rtw_mp_ioctl.c reported by
checkpatch.

CHECK: spaces preferred around that '|' (ctx:VxV)
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_mp.c
Michael Straube [Mon, 16 Aug 2021 15:58:07 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_mp.c

Clean up spacing style issues in core/rtw_mp.c reported by checkpatch.

CHECK: spaces preferred around that ...
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_mlme_ext.c
Michael Straube [Mon, 16 Aug 2021 15:58:06 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_mlme_ext.c

Clean up spacing style issues in core/rtw_mlme_ext.c reported by
checkpatch.

CHECK: spaces preferred around that ...
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_mlme.c
Michael Straube [Mon, 16 Aug 2021 15:58:05 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_mlme.c

Clean up spacing style issues in core/rtw_mlme.c reported by checkpatch.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add spaces around operators in core/rtw_iol.c
Michael Straube [Mon, 16 Aug 2021 15:58:04 +0000 (17:58 +0200)]
staging: r8188eu: add spaces around operators in core/rtw_iol.c

Add missing spaces around operators in core/rtw_iol.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_ioctl_set.c
Michael Straube [Mon, 16 Aug 2021 15:58:03 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_ioctl_set.c

Clean up spacing style issues in core/rtw_ioctl_set.c reported by
checkpatch.

CHECK: spaces preferred around that ...
WARNING: space prohibited before semicolon

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: simplify multiplication in core/rtw_ioctl_set.c
Michael Straube [Mon, 16 Aug 2021 15:58:02 +0000 (17:58 +0200)]
staging: r8188eu: simplify multiplication in core/rtw_ioctl_set.c

Simplify multiplication in core/rtw_ioctl_set.c. to improve readability
and clear a checkpatch issue.

CHECK: spaces preferred around that '/' (ctx:VxV)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_ieee80211.c
Michael Straube [Mon, 16 Aug 2021 15:58:01 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_ieee80211.c

Clean up spacing style issues in core/rtw_ieee80211.c reported by
checkpatch.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_efuse.c
Michael Straube [Mon, 16 Aug 2021 15:58:00 +0000 (17:58 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_efuse.c

Clean up spacing style issues in core/rtw_efuse.c reported by checkpatch.

CHECK: spaces preferred around that ...
WARNING: space prohibited before semicolon

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up spacing style issues in core/rtw_cmd.c
Michael Straube [Mon, 16 Aug 2021 15:57:59 +0000 (17:57 +0200)]
staging: r8188eu: clean up spacing style issues in core/rtw_cmd.c

Clean up spacing style issues in core/rtw_cmd.c reported by checkpatch.

CHECK: spaces preferred around that ...
CHECK: No space is necessary after a cast
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_cmd.c
Michael Straube [Mon, 16 Aug 2021 15:57:58 +0000 (17:57 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_cmd.c

Remove unnecessary parentheses in core/rtw_cmd.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rewrite subtraction in core/rtw_cmd.c
Michael Straube [Mon, 16 Aug 2021 15:57:57 +0000 (17:57 +0200)]
staging: r8188eu: rewrite subtraction in core/rtw_cmd.c

Rewrite subtraction in core/rtw_cmd.c to clear missing spaces around
operator reported by checkpatch.

256-1 -> 255

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add spaces around operators in core/rtw_ap.c
Michael Straube [Mon, 16 Aug 2021 15:57:56 +0000 (17:57 +0200)]
staging: r8188eu: add spaces around operators in core/rtw_ap.c

Add missing spaces around operators in core/rtw_ap.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210816155818.24005-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoMerge tag 'iio-for-5.15b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Tue, 17 Aug 2021 17:48:42 +0000 (19:48 +0200)]
Merge tag 'iio-for-5.15b' of https://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

2nd set of new IIO device support and cleanups for the 5.15 cycle.

A small pull request to pick up a few new drivers and some cleanup
and fix patches.

New device support
* ad5110 non-volatile digital potentiometer
  - New driver
* renesas rzl/gl2 12-bit / 8 channel ADC block
  - New driver and bindings

Minor or late breaking fixes and cleanups
* ltc2983
  - Fix a false assumption of initial interrupt during probe().
* hp03
  - Use devm_* to simplify probe and allow the remove function to be dropped.
* rockchip_saradc
  - Use a regulator notifier to reduce overheads of querying the scale.

* tag 'iio-for-5.15b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: adc: Add driver for Renesas RZ/G2L A/D converter
  dt-bindings: iio: adc: Add binding documentation for Renesas RZ/G2L A/D converter
  iio: pressure: hp03: update device probe to register with devm functions
  iio: adc: rockchip_saradc: add voltage notifier so get referenced voltage once at probe
  iio: ltc2983: fix device probe
  iio: potentiometer: Add driver support for AD5110
  dt-bindings: iio: potentiometer: Add AD5110 in trivial-devices

2 years agostaging: r8188eu: Remove unused nat25_handle_frame()
Fabio M. De Francesco [Mon, 16 Aug 2021 16:06:15 +0000 (18:06 +0200)]
staging: r8188eu: Remove unused nat25_handle_frame()

Remove nat25_handle_frame() because it is not called by any other
function of the driver.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210816160617.11949-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove ipx support from driver
Greg Kroah-Hartman [Mon, 16 Aug 2021 07:34:50 +0000 (09:34 +0200)]
staging: r8188eu: remove ipx support from driver

The ipx.h header files are being removed from the kernel, and support
for them was long removed from the tree, so remove all references to it
in the r8188eu driver as well, to allow it to continue to build properly
in linux-next

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210816073450.668993-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove inline markings from functions in rtw_br_ext.c
Greg Kroah-Hartman [Mon, 16 Aug 2021 07:34:49 +0000 (09:34 +0200)]
staging: r8188eu: remove inline markings from functions in rtw_br_ext.c

The compiler is free to ignore, or follow, "inline" markings so they
really have no use in .c files, so just remove them.

This allows functions to properly show up as being unused when all
callers to them are removed, otherwise gcc does not warn you about this.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210816073450.668993-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use common ieee80211 constants
Michael Straube [Sat, 14 Aug 2021 16:55:18 +0000 (18:55 +0200)]
staging: r8188eu: use common ieee80211 constants

Many defined constants in wifi.h are unused and/or available from
<linux/ieee80211.h>, some with slightly different names. Remove
the constants from wifi.h and use the common ones. Rename where
necessary.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210814165518.8672-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove kernel version depended code paths
Michael Straube [Sun, 15 Aug 2021 10:24:06 +0000 (12:24 +0200)]
staging: r8188eu: remove kernel version depended code paths

Remove kernel version depended code paths from the driver.
Reported by checkpatch.

WARNING: LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged

Acked-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210815102406.3707-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: Fix bitwise vs logical operator in TranslateRxSignalStuff819xUsb()
Nathan Chancellor [Sat, 14 Aug 2021 23:56:26 +0000 (16:56 -0700)]
staging: rtl8192u: Fix bitwise vs logical operator in TranslateRxSignalStuff819xUsb()

clang warns:

drivers/staging/rtl8192u/r8192U_core.c:4268:20: warning: bitwise and of
boolean expressions; did you mean logical and? [-Wbool-operation-and]
        bpacket_toself =  bpacket_match_bssid &
                          ^~~~~~~~~~~~~~~~~~~~~
                                              &&
1 warning generated.

Replace the bitwise AND with a logical one to clear up the warning, as
that is clearly what was intended.

Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210814235625.1780033-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: os_dep: Remove defined but not used variables
Fabio M. De Francesco [Sat, 14 Aug 2021 16:08:04 +0000 (18:08 +0200)]
staging: r8188eu: os_dep: Remove defined but not used variables

Remove defined but not used const variables. Issues detected by GCC
running with -Wunused-const-variable option enabled.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210814160804.11634-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove ODM_GetRightChnlPlaceforIQK()
Michael Straube [Sat, 14 Aug 2021 07:39:20 +0000 (09:39 +0200)]
staging: r8188eu: remove ODM_GetRightChnlPlaceforIQK()

Function ODM_GetRightChnlPlaceforIQK() returns always zero for
channels <= 14. The driver is for chips that do not support 5 GHz,
so remove the function and replace the usage of its return value
with zero.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210814073920.3551-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove unnecessary ret variable in rtw_drv_init()
Nathan Chancellor [Fri, 13 Aug 2021 20:14:18 +0000 (13:14 -0700)]
staging: r8188eu: Remove unnecessary ret variable in rtw_drv_init()

ret is unnecessary as both error paths set the same error code so just
return that directly.

Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210813201418.4018631-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove variables and simplify PHY_SwChnl8188E()
Fabio M. De Francesco [Fri, 13 Aug 2021 16:08:12 +0000 (18:08 +0200)]
staging: r8188eu: Remove variables and simplify PHY_SwChnl8188E()

Remove "bResult" and "tmpchannel" and all tests and assignments that
are related to them in the code of PHY_SwChnl8188E().

"bResult" was always true, therefore its test led to a null statement.
"tmpchannel" was used only to restore "pHalData->CurrentChannel" to its
previous value only if _PHY_SwChnl8192C() was not called; therefore
assign "channel" to "pHalData->CurrentChannel" if and only if
_PHY_SwChnl8192C() is to be executed (and get rid of that temporary
storage).

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210813160812.17603-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename Hal_GetChnlGroup88E()
Michael Straube [Fri, 13 Aug 2021 07:31:09 +0000 (09:31 +0200)]
staging: r8188eu: rename Hal_GetChnlGroup88E()

Rename Hal_GetChnlGroup88E() to avoid camel case.
HalGetChnlGroup88E -> hal_get_chnl_group_88e

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210813073109.25609-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
Michael Straube [Fri, 13 Aug 2021 07:31:08 +0000 (09:31 +0200)]
staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()

Rename parameter of Hal_GetChnlGroup88E() to avoid camel case.
pGroup -> group

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210813073109.25609-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
Michael Straube [Fri, 13 Aug 2021 07:31:07 +0000 (09:31 +0200)]
staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void

After the removal of 5GHz code from Hal_GetChnlGroup88E() the function
always returns true now. Convert the return type to void and change the
only user Hal_ReadTxPowerInfo88E() accordingly.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210813073109.25609-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
Michael Straube [Fri, 13 Aug 2021 07:31:06 +0000 (09:31 +0200)]
staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()

Remove 5GHz code from Hal_GetChnlGroup88E().

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210813073109.25609-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoMerge 5.14-rc6 into staging-next
Greg Kroah-Hartman [Mon, 16 Aug 2021 07:02:59 +0000 (09:02 +0200)]
Merge 5.14-rc6 into staging-next

We need the IIO fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoLinux 5.14-rc6
Linus Torvalds [Sun, 15 Aug 2021 23:40:53 +0000 (13:40 -1000)]
Linux 5.14-rc6

2 years agoMerge tag 'powerpc-5.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
Linus Torvalds [Sun, 15 Aug 2021 16:57:43 +0000 (06:57 -1000)]
Merge tag 'powerpc-5.14-5' of git://git./linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

 - Fix crashes coming out of nap on 32-bit Book3s (eg. powerbooks).

 - Fix critical and debug interrupts on BookE, seen as crashes when
   using ptrace.

 - Fix an oops when running an SMP kernel on a UP system.

 - Update pseries LPAR security flavor after partition migration.

 - Fix an oops when using kprobes on BookE.

 - Fix oops on 32-bit pmac by not calling do_IRQ() from
   timer_interrupt().

 - Fix softlockups on CPU hotplug into a CPU-less node with xive (P9).

Thanks to Cédric Le Goater, Christophe Leroy, Finn Thain, Geetika
Moolchandani, Laurent Dufour, Laurent Vivier, Nicholas Piggin, Pu Lehui,
Radu Rendec, Srikar Dronamraju, and Stan Johnson.

* tag 'powerpc-5.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/xive: Do not skip CPU-less nodes when creating the IPIs
  powerpc/interrupt: Do not call single_step_exception() from other exceptions
  powerpc/interrupt: Fix OOPS by not calling do_IRQ() from timer_interrupt()
  powerpc/kprobes: Fix kprobe Oops happens in booke
  powerpc/pseries: Fix update of LPAR security flavor after LPM
  powerpc/smp: Fix OOPS in topology_init()
  powerpc/32: Fix critical and debug interrupts on BOOKE
  powerpc/32s: Fix napping restore in data storage interrupt (DSI)

2 years agoMerge tag 'irq-urgent-2021-08-15' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 15 Aug 2021 16:49:40 +0000 (06:49 -1000)]
Merge tag 'irq-urgent-2021-08-15' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
 "A set of fixes for PCI/MSI and x86 interrupt startup:

   - Mask all MSI-X entries when enabling MSI-X otherwise stale unmasked
     entries stay around e.g. when a crashkernel is booted.

   - Enforce masking of a MSI-X table entry when updating it, which
     mandatory according to speification

   - Ensure that writes to MSI[-X} tables are flushed.

   - Prevent invalid bits being set in the MSI mask register

   - Properly serialize modifications to the mask cache and the mask
     register for multi-MSI.

   - Cure the violation of the affinity setting rules on X86 during
     interrupt startup which can cause lost and stale interrupts. Move
     the initial affinity setting ahead of actualy enabling the
     interrupt.

   - Ensure that MSI interrupts are completely torn down before freeing
     them in the error handling case.

   - Prevent an array out of bounds access in the irq timings code"

* tag 'irq-urgent-2021-08-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  driver core: Add missing kernel doc for device::msi_lock
  genirq/msi: Ensure deactivation on teardown
  genirq/timings: Prevent potential array overflow in __irq_timings_store()
  x86/msi: Force affinity setup before startup
  x86/ioapic: Force affinity setup before startup
  genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUP
  PCI/MSI: Protect msi_desc::masked for multi-MSI
  PCI/MSI: Use msi_mask_irq() in pci_msi_shutdown()
  PCI/MSI: Correct misleading comments
  PCI/MSI: Do not set invalid bits in MSI mask
  PCI/MSI: Enforce MSI[X] entry updates to be visible
  PCI/MSI: Enforce that MSI-X table entry is masked for update
  PCI/MSI: Mask all unused MSI-X entries
  PCI/MSI: Enable and mask MSI-X early

2 years agoMerge tag 'locking_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 15 Aug 2021 16:46:04 +0000 (06:46 -1000)]
Merge tag 'locking_urgent_for_v5.14_rc6' of git://git./linux/kernel/git/tip/tip

Pull locking fix from Borislav Petkov:

 - Fix a CONFIG symbol's spelling

* tag 'locking_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/rtmutex: Use the correct rtmutex debugging config option

2 years agoMerge tag 'efi_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 15 Aug 2021 16:38:26 +0000 (06:38 -1000)]
Merge tag 'efi_urgent_for_v5.14_rc6' of git://git./linux/kernel/git/tip/tip

Pull EFI fixes from Borislav Petkov:
 "A batch of fixes for the arm64 stub image loader:

   - fix a logic bug that can make the random page allocator fail
     spuriously

   - force reallocation of the Image when it overlaps with firmware
     reserved memory regions

   - fix an oversight that defeated on optimization introduced earlier
     where images loaded at a suitable offset are never moved if booting
     without randomization

   - complain about images that were not loaded at the right offset by
     the firmware image loader"

* tag 'efi_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi/libstub: arm64: Double check image alignment at entry
  efi/libstub: arm64: Warn when efi_random_alloc() fails
  efi/libstub: arm64: Relax 2M alignment again for relocatable kernels
  efi/libstub: arm64: Force Image reallocation if BSS was not reserved
  arm64: efi: kaslr: Fix occasional random alloc (and boot) failure

2 years agoMerge tag 'x86_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 15 Aug 2021 16:30:24 +0000 (06:30 -1000)]
Merge tag 'x86_urgent_for_v5.14_rc6' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:
 "Two fixes:

   - An objdump checker fix to ignore parenthesized strings in the
     objdump version

   - Fix resctrl default monitoring groups reporting when new subgroups
     get created"

* tag 'x86_urgent_for_v5.14_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/resctrl: Fix default monitoring groups reporting
  x86/tools: Fix objdump version check again

2 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Sun, 15 Aug 2021 16:21:30 +0000 (06:21 -1000)]
Merge tag 'for-linus' of git://git./virt/kvm/kvm

Pull KVM fixes from Paolo Bonzini:
 "ARM:

   - Plug race between enabling MTE and creating vcpus

   - Fix off-by-one bug when checking whether an address range is RAM

  x86:

   - Fixes for the new MMU, especially a memory leak on hosts with <39
     physical address bits

   - Remove bogus EFER.NX checks on 32-bit non-PAE hosts

   - WAITPKG fix"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: x86/mmu: Protect marking SPs unsync when using TDP MMU with spinlock
  KVM: x86/mmu: Don't step down in the TDP iterator when zapping all SPTEs
  KVM: x86/mmu: Don't leak non-leaf SPTEs when zapping all SPTEs
  KVM: nVMX: Use vmx_need_pf_intercept() when deciding if L0 wants a #PF
  kvm: vmx: Sync all matching EPTPs when injecting nested EPT fault
  KVM: x86: remove dead initialization
  KVM: x86: Allow guest to set EFER.NX=1 on non-PAE 32-bit kernels
  KVM: VMX: Use current VMCS to query WAITPKG support for MSR emulation
  KVM: arm64: Fix race when enabling KVM_ARM_CAP_MTE
  KVM: arm64: Fix off-by-one in range_is_memory