Skip to contentSkip to conversation

build failure of next-20220818 due to 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters")

DISCUSSION Sudip Mukherjee (Codethink) 3 participants 4 messages Aug 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi All,

Not sure if it has been reported, clang builds of arm64 allmodconfig have failed to build next-20220818 with the error:

drivers/net/wireless/realtek/rtw88/main.c:731:2: error: variable 'primary_channel_idx' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]

        default:
        ^~~~~~~
drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized use occurs here
        hal->current_primary_channel_index = primary_channel_idx;
                                             ^~~~~~~~~~~~~~~~~~~

git bisect pointed to 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters"). And, reverting that commit has fixed the build failure.

I will be happy to test any patch or provide any extra log if needed.

--
Regards
Sudip

#1 lore raw
Quoted 13 lines · Sudip Mukherjee (Codethink)

Hi All,

Not sure if it has been reported, clang builds of arm64 allmodconfig have failed to build next-20220818 with the error:

drivers/net/wireless/realtek/rtw88/main.c:731:2: error: variable 'primary_channel_idx' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]

        default:
        ^~~~~~~
drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized use occurs here
        hal->current_primary_channel_index = primary_channel_idx;
                                             ^~~~~~~~~~~~~~~~~~~
Quoted 4 lines

git bisect pointed to 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters"). And, reverting that commit has fixed the build failure.

I will be happy to test any patch or provide any extra log if needed.

Hi Sudeep,

in my experience, you get the best results by posting a patch instead of a bug report
when you spot a new warning. If you are unsure it's the right fix, just state that
in the description. The maintainers will then either be able to just pick it up if
it looks correct, or be motivated to do a better patch if they don't like it. ;-)

In this case, I think the best fix would be to merged the 'default' with the 'case
RTW_CHANNEL_WIDTH_20' in the switch statement, and use RTW_SC_DONT_CARE. Of course, I have no idea if that is the right fix, but it would make sense.

Just try to avoid adding initializations to the variable declaration, as that would prevent the compiler from warning if there is a new uninitialized use.

Arnd

#2 lore raw
Quoted 3 lines · Arnd Bergmann

Hi Sudeep,

Sorry Sudip for misspelling your name...

Arnd

#3 lore raw
In reply to Arnd Bergmann
Quoted 32 lines · Arnd Bergmann
Quoted 13 lines · Sudip Mukherjee (Codethink)

Hi All,

Not sure if it has been reported, clang builds of arm64 allmodconfig have failed to build next-20220818 with the error:

drivers/net/wireless/realtek/rtw88/main.c:731:2: error: variable 'primary_channel_idx' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]

        default:
        ^~~~~~~
drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized use occurs here
        hal->current_primary_channel_index = primary_channel_idx;
                                             ^~~~~~~~~~~~~~~~~~~
Quoted 5 lines

git bisect pointed to 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters").
And, reverting that commit has fixed the build failure.

I will be happy to test any patch or provide any extra log if needed.

Hi Sudeep,

in my experience, you get the best results by posting a patch instead of a bug report
when you spot a new warning. If you are unsure it's the right fix, just state that
in the description. The maintainers will then either be able to just pick it up if
it looks correct, or be motivated to do a better patch if they don't like it. ;-)

Quoted 9 lines

In this case, I think the best fix would be to merged the 'default' with the 'case
RTW_CHANNEL_WIDTH_20' in the switch statement, and use RTW_SC_DONT_CARE. Of course, I have no idea if that is the right fix, but it would make sense.

Just try to avoid adding initializations to the variable declaration, as that would prevent the compiler from warning if there is a new uninitialized use.

I have sent a patch to fix this:
https://lore.kernel.org/linux-wireless/[email protected]/T/#u

Ping-Ke