* [PATCH v5 0/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix shadowed index
@ 2025-07-18 2:52 Vivek BalachandharTN
2025-07-18 2:52 ` [PATCH v5 1/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index name Vivek BalachandharTN
0 siblings, 1 reply; 4+ messages in thread
From: Vivek BalachandharTN @ 2025-07-18 2:52 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN
This is my first contribution to Linux Kernel.
This patch addresses a naming inconsistency in the rtl8192u driver.
- The global array `ChannelPlan` has been renamed to `channel_plan` to follow Linux kernel naming conventions.
- The local variable used as an index into this array was also named `channel_plan`, which caused shadowing. It has been renamed to `chan` for clarity and to avoid confusion.
Changes since v4:
- Renamed `chan_plan_idx` to `chan` per Dan Carpenter’s suggestion.
- Removed unrelated and accidental changes to `Makefile` and `init/main.c`.
This change improves code readability and compliance with kernel coding style.
---
Vivek BalachandharTN (1):
staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index
name
drivers/staging/rtl8192u/r8192U_core.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v5 1/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index name
2025-07-18 2:52 [PATCH v5 0/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix shadowed index Vivek BalachandharTN
@ 2025-07-18 2:52 ` Vivek BalachandharTN
2025-07-18 7:43 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Vivek BalachandharTN @ 2025-07-18 2:52 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN
This patch renames the global array ChannelPlan to channel_plan
to follow Linux kernel coding style. Also renamed the index
variable from channel_plan to chan_plan_idx to avoid
shadowing and improve readability.
v2:
- Fixed Cc list to include Greg and staging list
v3:
- Removed EXTRAVERSION = -vivek from Makefile.
v4:
- Tested and verified Makefile EXTRAVERSION removal does not break build
- Removed EXTRAVERSION = -vivek to keep version clean
v5:
- Renamed chan_plan_idx to chan per Dan Carpenter's feedback.
- Removed mistaken blank line addition in init/main.c.
- Removed unrelated changes to Makefile and init/main.c.
Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
drivers/staging/rtl8192u/r8192U_core.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 0a60ef201..092f36383 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -120,7 +120,7 @@ struct CHANNEL_LIST {
u8 Len;
};
-static struct CHANNEL_LIST ChannelPlan[] = {
+static struct CHANNEL_LIST channel_plan[] = {
/* FCC */
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165}, 24},
/* IC */
@@ -145,12 +145,12 @@ static struct CHANNEL_LIST ChannelPlan[] = {
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14}
};
-static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)
+static void rtl819x_set_channel_map(u8 chan, struct r8192_priv *priv)
{
int i, max_chan = -1, min_chan = -1;
struct ieee80211_device *ieee = priv->ieee80211;
- switch (channel_plan) {
+ switch (chan) {
case COUNTRY_CODE_FCC:
case COUNTRY_CODE_IC:
case COUNTRY_CODE_ETSI:
@@ -172,15 +172,17 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)
"unknown rf chip, can't set channel map in function:%s()\n",
__func__);
}
- if (ChannelPlan[channel_plan].Len != 0) {
+ if (channel_plan[chan].Len != 0) {
/* Clear old channel map */
memset(GET_DOT11D_INFO(ieee)->channel_map, 0,
sizeof(GET_DOT11D_INFO(ieee)->channel_map));
/* Set new channel map */
- for (i = 0; i < ChannelPlan[channel_plan].Len; i++) {
- if (ChannelPlan[channel_plan].Channel[i] < min_chan || ChannelPlan[channel_plan].Channel[i] > max_chan)
+ for (i = 0; i < channel_plan[chan].Len; i++) {
+ if (channel_plan[chan].Channel[i] < min_chan ||
+ channel_plan[chan].Channel[i] > max_chan)
break;
- GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1;
+ GET_DOT11D_INFO(ieee)->channel_map
+ [channel_plan[chan].Channel[i]] = 1;
}
}
break;
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v5 1/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index name
2025-07-18 2:52 ` [PATCH v5 1/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index name Vivek BalachandharTN
@ 2025-07-18 7:43 ` Greg KH
2025-07-18 18:29 ` Vivek BalachandharTN
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2025-07-18 7:43 UTC (permalink / raw)
To: Vivek BalachandharTN; +Cc: linux-staging, linux-kernel
On Fri, Jul 18, 2025 at 02:52:06AM +0000, Vivek BalachandharTN wrote:
> This patch renames the global array ChannelPlan to channel_plan
> to follow Linux kernel coding style. Also renamed the index
> variable from channel_plan to chan_plan_idx to avoid
> shadowing and improve readability.
>
> v2:
> - Fixed Cc list to include Greg and staging list
>
> v3:
> - Removed EXTRAVERSION = -vivek from Makefile.
>
> v4:
> - Tested and verified Makefile EXTRAVERSION removal does not break build
> - Removed EXTRAVERSION = -vivek to keep version clean
>
> v5:
> - Renamed chan_plan_idx to chan per Dan Carpenter's feedback.
> - Removed mistaken blank line addition in init/main.c.
> - Removed unrelated changes to Makefile and init/main.c.
>
> Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
> ---
> drivers/staging/rtl8192u/r8192U_core.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
Again, please read the documentation file for how to properly put a
version log for the patch (it goes below the --- line.) Look at the
hundreds/thousands of examples on the public mailing lists for examples
of what to do here.
And also, please make sure that your patch actually applies against the
latest development tree (i.e. linux-next or the subsystem development
tree.) I don't think that's the case here at all :(
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v5 1/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index name
2025-07-18 7:43 ` Greg KH
@ 2025-07-18 18:29 ` Vivek BalachandharTN
0 siblings, 0 replies; 4+ messages in thread
From: Vivek BalachandharTN @ 2025-07-18 18:29 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-staging, vivek.balachandhar
Hi Greg,
The `rtl8192u` driver was removed from the kernel in commit 697455ce4110 on October 14, 2023, due to it being broken since 2016. As such, the patch I submitted for renaming `ChannelPlan` is no longer applicable.
I will pick another driver from `drivers/staging/` to work on for further contributions.
Thanks!
Vivek Balachandhar
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-18 18:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18 2:52 [PATCH v5 0/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix shadowed index Vivek BalachandharTN
2025-07-18 2:52 ` [PATCH v5 1/1] staging: rtl8192u: Rename ChannelPlan to channel_plan and fix index name Vivek BalachandharTN
2025-07-18 7:43 ` Greg KH
2025-07-18 18:29 ` Vivek BalachandharTN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).