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>
Based on lwfinger/rtlwifi_new/commit/2b3cb6be0aed5cbcd4318a7e63d39e499b5094c0#diff-839e3ea33b3a136b794f7a0281eead7c
Signed-off-by: John-Eric Kamps <john-eric.kamps@honeywell.com>
Since commit 736706bee3298208343a76096370e4f6a5c55915 get_ds was removed which is internally mapped to KERNEL_DS.
Signed-off-by: John-Eric Kamps <john-eric.kamps@honeywell.com>