When packaging the source as a Debian DKMS package, lintian will warn
national-encoding due to Big5 encoded characters in comments.
Update to English comments from other files when available, and
reencode Chinese in UTF-8.
Signed-off-by: ZHANG Yuntian <yt@radxa.com>
As the comment says, rtnl_lock is acquired by the caller of this
function. In fact this is not specific to 2.6.26 and later but has
always been the case, so checking lock state is unnecessary and we can
just call (un)register_netdevice() knowing that rtnl_lock is held.
rtnl_is_locked() checks whether the lock is currently held by any task,
not specifically by _this_ task so it is wrong to use it in the
(un)register path.
In both of these cases, examining the call stack shows that there is no
way for rtnl_lock to be taken by the task running these functions, so
remove the checks.
Further, (un)register_netdev() have existed since the beginning of Git
history so there's no reason for a version check here and we can always
call the function that takes the lock itself and should never call the
version which expects rtnl_lock to be held.
Allocation function return memory that is properly aligned for most data
types, there is no need to manually align the buffer later.
On 64-bit systems this is particularly wrong as struct sta_info should
be 8-byte aligned so this calculation is guaranteed to misalign the
structure. If the architecture requires aligned access, this leads to
an alignment fault and panic.
Signed-off-by: John Keeping <john@metanate.com>
At the moment USER_EXTRA_CFLAGS can't override local Makfile EXTRA_CFLAGS
since it's assigned at the beginning of the Makefile. For example it's not
possible to undefine the hardcoded CONFIG_LITTLE_ENDIAN and this doesn't
allow to build these modules for big endian architectures. So let's move
the assignment of USER_EXTRA_CFLAGS to EXTRA_CFLAGS after the last
EXTRA_CFLAGS assignment.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Building with GCC 12.2 results in:
/var/lib/dkms/licheerv-rtl8723ds/1.0/build/core/rtw_sta_mgt.c:
In function ‘rtw_mfree_stainfo’:
/var/lib/dkms/licheerv-rtl8723ds/1.0/build/core/rtw_sta_mgt.c:338:25:
warning: the comparison will always evaluate as ‘true’ for
the address of ‘lock’ will never be NULL [-Waddress]
338 | if (&psta->lock != NULL)
|
Remove the superfluous check.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fix the following errors that happen on a 5.19 kernel:
error: initialization of ‘int (*)(struct wiphy *, struct net_device *, unsigned int)’
from incompatible pointer type ‘int (*)(struct wiphy *, struct net_device *)’
[-Werror=incompatible-pointer-types]
6821 | .stop_ap = cfg80211_rtw_stop_ap,
error: ‘struct wireless_dev’ has no member named ‘current_bss’
7052 | if (wdev->current_bss) {
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
There's no need for a raw spinlock in this driver as it doesn't do
anything in hardirq context on -rt. Some of the critical sections
guarded by these locks are long and contain unbounded loops so there is
a risk of raw spinlocks causing latency spikes on -rt.
The existing code is broken with CONFIG_PREEMPT_RT anyway as only a
subset of the functions that depend on lock type are covered by the
preprocessor #if/#else blocks.
Remove the special-case for CONFIG_PREEMPT_RT.
Signed-off-by: John Keeping <john@metanate.com>