Commit Graph

1428565 Commits

Author SHA1 Message Date
Gabriel Rondon
adb44bab0a staging: most: dim2: replace BUG_ON() in configure_channel()
Replace BUG_ON() range check on ch_idx with a return of -EINVAL.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-4-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:46:39 +02:00
Gabriel Rondon
2466b3dd40 staging: most: dim2: replace BUG_ON() in service_done_flag()
Replace BUG_ON() calls with an early return since the function returns
void.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-3-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:46:38 +02:00
Gabriel Rondon
f3dc6732fd staging: most: dim2: replace BUG_ON() in try_start_dim_transfer()
Replace BUG_ON() calls with graceful error handling.

For the null/uninitialized channel checks, return -EINVAL instead of
crashing the kernel. For the zero bus_address check, release the
spinlock and return -EFAULT.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-2-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:46:38 +02:00
Mashiro Chen
f019e98a2f staging: rtl8723bs: remove unused RTL8188E antenna selection macros
Remove the SET_TX_DESC_ANTSEL_{A,B,C}_88E macros from odm_types.h.
These are leftover dead code for the RTL8188E chip and have no callers
in the rtl8723bs driver. The RTL8188E is a different chip family and
has its own driver at drivers/net/wireless/realtek/rtl8xxxu

This addresses the TODO item "find and remove any code for other chips
that is left over".

Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Link: https://patch.msgid.link/20260331050434.102744-1-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:41:48 +02:00
Mashiro Chen
27d51f0660 staging: rtl8723bs: remove redundant blank lines in basic_types.h
Remove redundant blank lines at the top of the file to improve
code cleanliness.

Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260330114232.91431-4-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:38:43 +02:00
Mashiro Chen
e8fa04fd77 staging: rtl8723bs: wrap complex macros with parentheses
Fix "COMPLEX_MACRO" errors reported by checkpatch.pl
by wrapping macro values in parentheses to ensure
correct operator precedence.

Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260330114232.91431-3-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:38:43 +02:00
Mashiro Chen
e2b69a082c staging: rtl8723bs: remove unused WRITEEF/READEF byte macros
The WRITEEF4BYTE, WRITEEF2BYTE, WRITEEF1BYTE, READEF4BYTE,
READEF2BYTE and READEF1BYTE macros are never used in the driver.
Remove them entirely.

Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260330114232.91431-2-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:38:43 +02:00
Bhavya Gupta
07ddb1d5d6 staging: rtl8723bs: rename camelCase variable
Rename the "pIE" variable to "ie" to comply with the linux kernel coding
style.

This fixes the following checkpatch.pl warnings:
	CHECK: Avoid CamelCase: <pIE>

Signed-off-by: Bhavya Gupta <anim8tor.ing@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/ab6aELnTA0EnQI6X@gamin8ing
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:35:51 +02:00
Haoyu Lu
65978823ce staging: greybus: audio: fix error message for BTN_3 button
In gbaudio_init_jack(), when setting SND_JACK_BTN_3 key, the error
message incorrectly says "Failed to set BTN_0". This should be
"Failed to set BTN_3" to match the button being configured.

Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260330083425.266-1-hechushiguitu666@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:34:30 +02:00
David Holland
a5a1b468de staging: rtl8723bs: rename variables to snake_case
The Linux kernel coding style guidelines prohibit the use of CamelCase
variable names. All variables should be snakecase.

Rename the 'ChipVersion' parameter to 'chip_version' and the
'AutoLoadFail' parameter to 'auto_load_fail' in hal_com.c to adhere to
the standard snakecase naming convention.

Signed-off-by: David Holland <david@cardinalsystem.net>
Link: https://patch.msgid.link/20260327203636.24891-1-david@cardinalsystem.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:34:19 +02:00
Haoyu Lu
d915dde6cf staging: rtl8723bs: fix spelling in comment
Change "co-existance" to "co-existence" in comment.

Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260327111455.3260-1-hechushiguitu666@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:34:15 +02:00
Omer El Idrissi
7088561c8f staging: rtl8723bs: cleanup return in sdio_init()
Make sdio_init() return errno from sdio_enable_func or
sdio_set_block_size instead of _SUCCESS/_FAIL vendor-defined
macros. Let rtw_resume_process_normal return errno returned by
sdio_init instead of -1. sdio_dvobj_init returns NULL on error
so leave that as is. Let sdio_dvobj_init use a slightly more
readable and conventional error check for sdio_init().

Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260326093607.13011-3-omer.e.idrissi@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:34:05 +02:00
Omer El Idrissi
2b0da1fafb staging: rtl8723bs: use direct returns in sdio_dvobj_init()
Make sdio_dvobj_init() use direct returns

Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
Signed-off-by: Omer El Idrissi <omer.e.idriss@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260326093607.13011-2-omer.e.idrissi@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:34:05 +02:00
Rodrigo Gobbi
6671dbbb12 staging: rtl8723bs: remove unused arg at odm_interface.h
The header file uses some macros to create proper constants for
ODM_REG and ODM_SET but current macros were not using _ic_type,
leading to a checkpatch warn:

WARNING: Argument '_ic_type' is not used in function-like macro

Remove that arg, currently there is no support for per ic type

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Link: https://patch.msgid.link/20260325212826.20309-1-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:33:57 +02:00
Damien Riégel
84265cbd96 greybus: raw: fix use-after-free if write is called after disconnect
If a user writes to the chardev after disconnect has been called, the
kernel panics with the following trace (with
CONFIG_INIT_ON_FREE_DEFAULT_ON=y):

        BUG: kernel NULL pointer dereference, address: 0000000000000218
         ...
        Call Trace:
         <TASK>
         gb_operation_create_common+0x61/0x180
         gb_operation_create_flags+0x28/0xa0
         gb_operation_sync_timeout+0x6f/0x100
         raw_write+0x7b/0xc7 [gb_raw]
         vfs_write+0xcf/0x420
         ? task_mm_cid_work+0x136/0x220
         ksys_write+0x63/0xe0
         do_syscall_64+0xa4/0x290
         entry_SYSCALL_64_after_hwframe+0x77/0x7f

Disconnect calls gb_connection_destroy, which ends up freeing the
connection object. When gb_operation_sync is called in the write file
operations, its gets a freed connection as parameter and the kernel
panics.

The gb_connection_destroy cannot be moved out of the disconnect
function, as the Greybus subsystem expect all connections belonging to a
bundle to be destroyed when disconnect returns.

To prevent this bug, use a rw lock to synchronize access between write
and disconnect. This guarantees that the write function doesn't try
to use a disconnected connection.

Fixes: e806c7fb8e ("greybus: raw: add raw greybus kernel driver")
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Damien Riégel <damien.riegel@silabs.com>
Link: https://patch.msgid.link/20260324140039.40001-2-damien.riegel@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:33:48 +02:00
Damien Riégel
983cc2c7ef greybus: raw: fix use-after-free on cdev close
This addresses a use-after-free bug when a raw bundle is disconnected
but its chardev is still opened by an application. When the application
releases the cdev, it causes the following panic when init on free is
enabled (CONFIG_INIT_ON_FREE_DEFAULT_ON=y):

        refcount_t: underflow; use-after-free.
        WARNING: CPU: 0 PID: 139 at lib/refcount.c:28 refcount_warn_saturate+0xd0/0x130
         ...
        Call Trace:
         <TASK>
         cdev_put+0x18/0x30
         __fput+0x255/0x2a0
         __x64_sys_close+0x3d/0x80
         do_syscall_64+0xa4/0x290
         entry_SYSCALL_64_after_hwframe+0x77/0x7f

The cdev is contained in the "gb_raw" structure, which is freed in the
disconnect operation. When the cdev is released at a later time,
cdev_put gets an address that points to freed memory.

To fix this use-after-free, convert the struct device from a pointer to
being embedded, that makes the lifetime of the cdev and of this device
the same. Then, use cdev_device_add, which guarantees that the device
won't be released until all references to the cdev have been released.
Finally, delegate the freeing of the structure to the device release
function, instead of freeing immediately in the disconnect callback.

Fixes: e806c7fb8e ("greybus: raw: add raw greybus kernel driver")
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Damien Riégel <damien.riegel@silabs.com>
Link: https://patch.msgid.link/20260324140039.40001-1-damien.riegel@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:33:48 +02:00
Sajal Gupta
d6696ce720 staging: rtl8723bs: fix logical continuations in xmit_linux.c
Simplify the conditional by removing redundant boolean
comparisons and fixing the continuation line indentation.

Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260324121828.14675-1-sajal2005gupta@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:33:29 +02:00
Junrui Luo
75a1621e4f staging: sm750fb: fix division by zero in ps_to_hz()
ps_to_hz() is called from hw_sm750_crtc_set_mode() without validating
that pixclock is non-zero. A zero pixclock passed via FBIOPUT_VSCREENINFO
causes a division by zero.

Fix by rejecting zero pixclock in lynxfb_ops_check_var(), consistent
with other framebuffer drivers.

Fixes: 81dee67e21 ("staging: sm750fb: add sm750 to staging")
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881AFBFCE28CCF528B35D0CAF4BA@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:33:21 +02:00
Nikolay Kulikov
2541d18229 staging: rtl8723bs: remove custom is_multicast_mac_addr() function
is_multicast_mac_addr() is redundant reimplementation of standard
is_multicast_ether_addr() func.
Remove it and switch to use is_multicast_ether_addr().

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-7-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:32:06 +02:00
Nikolay Kulikov
1ee6776345 staging: rtl8723bs: remove custom is_broadcast_mac_addr() function
Replace the custom broadcast address checking function with standard
kernel is_broadcast_ether_addr() func for this.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-6-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:32:05 +02:00
Nikolay Kulikov
93854e4dd5 staging: rtl8723bs: remove custom is_zero_mac_addr() function
Remove the custom function is_zero_mac_addr() and replace all calls to it
with the default kernel function is_zero_ether_addr() to avoid
duplicating existing code.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-5-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:31:18 +02:00
Nikolay Kulikov
4fa02e833e staging: rtl8723bs: move logical operators to end of previous line
Change the position of logical operators '||' and remove unnecessary
curly braces around single expression to fix checkpatch.pl warnings.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-4-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:31:18 +02:00
Nikolay Kulikov
b5f801a424 staging: rtl8723bs: remove dead code in validate_recv_mgnt_frame()
Remove unused code from the validate_recv_mgnt_frame() function. This
code was previously commented out and is no longer needed.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-3-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:31:18 +02:00
Nikolay Kulikov
c4587d059e staging: rtl8723bs: replace deeply nested if-else with switch-case
The main logic of the validate_recv_mgnt_frame() function is deeply
nested due to multiple if-else statements and additional block scope.
Fix this by replacing identical if-else with switch-case statements,
which will improve code readability and correct checkpatch.pl warnings
about line lengths.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-2-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:31:17 +02:00
Lin YuChen
8c964b82a4 staging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()
Initialize le_tmp64 to zero in rtw_BIP_verify() to prevent using
uninitialized data.

Smatch warns that only 6 bytes are copied to this 8-byte (u64)
variable, leaving the last two bytes uninitialized:

drivers/staging/rtl8723bs/core/rtw_security.c:1308 rtw_BIP_verify()
warn: not copying enough bytes for '&le_tmp64' (8 vs 6 bytes)

Initializing the variable at the start of the function fixes this
warning and ensures predictable behavior.

Fixes: 554c0a3abf ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable <stable@kernel.org>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-staging/abvwIQh0CHTp4wNJ@stanley.mountain/
Signed-off-by: Lin YuChen <starpt.official@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260320172502.167332-1-starpt.official@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:31:04 +02:00
Oskar Ray-Frayssinet
3fc7b932b7 staging: rtl8723bs: remove unused function declarations
Remove unused declarations of MRateToHwRate8723B() and
HwRateToMRate8723B() from rtl8723b_hal.h as they have no
implementation and are never called.

Signed-off-by: Oskar Ray-Frayssinet <rayfraytech@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260321223347.7054-1-rayfraytech@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:30:51 +02:00
Jose A. Perez de Azpillaga
ff97e01144 staging: rtl8723bs: refactor rtw_joinbss_event_prehandle to reduce indentation
The rtw_joinbss_event_prehandle function has excessive indentation due
to deeply nested if-statements.

Refactor the function using early returns and guard clauses for the
failure paths. This flattens the code and significantly improves
readability.

Signed-off-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260321182713.665872-3-azpijr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:30:41 +02:00
Jose A. Perez de Azpillaga
96e82c72fe staging: rtl8723bs: remove dead REJOIN code
The REJOIN macro is not defined anywhere in the kernel tree. Remove this
dead code to simplify the function.

Signed-off-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260321182713.665872-2-azpijr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:30:41 +02:00
Lin YuChen
e23ad15700 staging: rtl8723bs: use guard clause for stainfo check
Continue the refactor of rtw_aes_decrypt() by introducing a guard
clause for the stainfo check. This allows the subsequent multicast
and unicast decryption logic to be moved one indentation level to
the left, further improving code readability.

Signed-off-by: Lin YuChen <starpt.official@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260319120737.29692-3-starpt.official@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:30:27 +02:00
Lin YuChen
d359ab14db staging: rtl8723bs: use guard clause for AES check
Refactor the AES encryption check by using a guard clause to
reduce the indentation level of the subsequent logic.

Signed-off-by: Lin YuChen <starpt.official@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260319120737.29692-2-starpt.official@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:30:27 +02:00
Marco Antonio Solis Segura
29372c18c7 staging: rtl8723bs: split multiple assignment in rtw_mgmt_xmitframe_coalesce
Cleanup the multiple assignment of tmp_buf and BIP_AAD to fix the
checkpatch.pl CHECK: "Multiple assignments should be avoided".

Additionally, reorder the assignments to ensure tmp_buf is assigned
only after BIP_AAD has been validated as non-NULL.

Signed-off-by: Marco Antonio Solis Segura <mshdevv@gmail.com>
Link: https://patch.msgid.link/20260319062626.605200-1-mshdevv@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:30:17 +02:00
Bera Yüzlü
092ba18ddd staging: rtl8723bs: Remove dead code
Clean up the dm_odm_t structure by removing commented-out members and
related legacy comments.

Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260318195005.23962-1-b9788213@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:29:06 +02:00
Oskar Ray-Frayssinet
82e1c68ac2 staging: rtl8723bs: add missing blank lines after declarations
Add missing blank lines after variable declarations in several files
throughout the rtl8723bs driver to comply with kernel coding style.

Signed-off-by: Oskar Ray-Frayssinet <rayfraytech@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260314122325.7877-1-rayfraytech@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:58:18 +01:00
Andrea Poldi
390c784709 staging: rtl8723bs: fix line length warning
Break a long function call across two lines in order to make code
easier to read and also comply with the Linux coding style.

Problem was found using checkpatch.pl tool.

Signed-off-by: Andrea Poldi <andrea@riposetti.com>
Link: https://patch.msgid.link/20260317165845.12594-1-andrea@riposetti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:57:10 +01:00
Giacomo Di Clerico
efa140029a staging: rtl8723bs: simplify return checks in validate_recv_data_frame()
Combine the return value checks for _FAIL and RTW_RX_HANDLED into a
single logical OR statement and remove unnecessary braces. This improves
code readability and resolves the following checkpatch.pl warning:
"WARNING: braces {} are not necessary for any arm of this statement"

Signed-off-by: Giacomo Di Clerico <giacomodiclerico@gmail.com>
Link: https://patch.msgid.link/20260317100723.72476-1-giacomodiclerico@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:56:58 +01:00
Marcos Andrade
f8252d54c4 staging: rtl8723bs: Replace msleep() with fsleep()
Replace msleep(10) with fsleep(10 * USEC_PER_MSEC)
in _rtw_init_xmit_priv().
fsleep() is the new standard API for delays, as it automatically chooses
the best sleep method based on the duration.

Suggested-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Marcos Andrade <marcosandrade95963@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260316221924.4904-3-marcosandrade95963@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:52:59 +01:00
Marcos Andrade
9b17baf171 staging: rtl8723bs: Replace network magic numbers with EtherType macros
Replace hardcoded magic numbers for network protocols (e.g., 0x0806
for ARP, 0x888e for EAPOL) with their standard EtherType macro
equivalents (ETH_P_ARP, ETH_P_PAE) defined in <linux/if_ether.h>.

This change improves code readability and aligns the driver with
standard Linux networking definitions.

Signed-off-by: Marcos Andrade <marcosandrade95963@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260316221924.4904-2-marcosandrade95963@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:52:59 +01:00
Bera Yüzlü
97eef87a54 staging: rtl8723bs: change custom comparing function to strcmp()
eqNByte() function is a redundant reimplementation of strcmp().
Remove eqNByte() and switch its usages to strcmp().
No functional change.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
Link: https://patch.msgid.link/20260309184556.846-2-b9788213@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:52:46 +01:00
Marcos Andrade
77da49db33 staging: rtl8723bs: remove unused global efuse variables
Remove several global efuse variables from rtw_efuse.c and their
corresponding extern declarations in rtw_efuse.h.

These variables (fakeEfuseBank, BTEfuseUsedBytes, etc.) are completely
unused legacy code. The driver currently maintains the efuse state
properly within the 'efuse_hal' structure, which is encapsulated
inside 'hal_com_data'.

The removal of this dead code cleans up the global namespace and
resolves multiple checkpatch.pl warnings regarding CamelCase naming
conventions. Verified by compilation that no functional code references
these variables.

Signed-off-by: Marcos Andrade <marcosandrade95963@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260316220435.2249-1-marcosandrade95963@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:52:35 +01:00
Nikolay Kulikov
816e181560 staging: rtl8723bs: remove unusual 'NDIS_802_11_MAC_ADDRESS' type
Remove the 'NDIS_802_11_MAC_ADDRESS' type and replace all variables of
this type with an array of 'u8', which will make the code more
understandable and get rid of unnecessary 'typedef'.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260316113427.3696-1-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:52:25 +01:00
Joshua Gu
c1dd45eed8 staging: rtl8723bs: remove unnecessary spaces in rtw_security.c
Fix checkpatch.pl warnings about spaces after casts,
along with other double spaces.

Signed-off-by: Joshua Gu <joshuagu789@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/abdlQzChJylv8evY@ubuntuarm64
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:50:27 +01:00
Joshua Gu
f689f461fe staging: rtl8723bs: remove redundant blank line in rtw_btcoex.c
Removed extra blank line, as reported by checkpatch.pl

Signed-off-by: Joshua Gu <joshuagu789@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/abcIbKgPQWkIB6vg@ubuntuarm64
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:50:11 +01:00
Nikolay Kulikov
7da5c11368 staging: rtl8723bs: remove unnecessary 'ETH_ALEN' definition
The ETH_ALEN macro is already declared in the Kernel headers, so there
is no need to redefine it here.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260315131734.25054-1-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:49:59 +01:00
Giacomo Di Clerico
91233340b4 staging: greybus: loopback: remove unused argument from macro
The gb_dev_loopback_ro_attr macro accepted a 'conn' argument which
was never used in its expansion. Remove it from both the macro
definition and its invocation.

Signed-off-by: Giacomo Di Clerico <giacomodiclerico@gmail.com>
Link: https://patch.msgid.link/20260315105853.34609-1-giacomodiclerico@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:49:22 +01:00
Lukas Kraft
6e57c05a06 staging: rtl8723bs: fix blank line style in rtw_io.c
Fix checkpatch style check for blank line placement after functions
in rtw_io.c.

Signed-off-by: Lukas Kraft <rebootrequired42@gmail.com>
Reviewed-by: Bera Yüzlü <b9788213@gmail.com>
Link: https://patch.msgid.link/20260312173903.19822-1-rebootrequired42@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:49:12 +01:00
Bera Yüzlü
3f7004a175 staging: rtl8723bs: Remove space in the line start
Remove a space in the line start to follow kernel coding style.
Reported by checkpatch.pl.

Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
Reviewed-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260310125556.874-2-b9788213@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:49:01 +01:00
Luis Soza Rodriguez
a11fdb9f58 staging: greybus: loopback: use sysfs_emit in sysfs show functions
As per the kernel's documentation, sysfs_emit() is the preferred way
to format strings for sysfs attributes. It handles buffer overruns
safely. Replace sprintf calls with sysfs_emit across all loopback
sysfs show macros.

Signed-off-by: Luis Soza Rodriguez <contact@sluisr.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260309230507.4931-1-contact@sluisr.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:48:48 +01:00
Mark Adamenko
e66cd5a8f2 staging: octeon: remove BUG() call
An unreachable default case calls BUG(). Remove the entire default case,
as the three possible cases are already addressed.

Signed-off-by: Mark Adamenko <marusik.adamenko@gmail.com>
Link: https://patch.msgid.link/20260310014514.40293-1-marusik.adamenko@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:48:40 +01:00
Nikolay Kulikov
7f9e3268fb staging: rtl8723bs: replace rtw_linked_check() return type to bool
Function rtw_linked_check() always return 'bool' value, but it's type
'int'. Replace 'int' with 'bool' to make it more accurate.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260309201257.16984-5-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:47:53 +01:00
Nikolay Kulikov
c776297d23 staging: rtl8723bs: replace rtw_is_desired_network() return type to bool
Function rtw_is_desired_network() used only in rtw_mlme.c file and
always return 'true' or 'false', so it's type can be replaced
with 'static bool'.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260309201257.16984-4-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:47:53 +01:00