staging: rtl8723bs: bug or pointless if else ?
Hi,
I stumbled upon the following if else construct in drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618
if (pwrpriv->bInternalAutoSuspend)
{
ret = rtw_resume_process(padapter);
}
else
{
if (pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode)
{
ret = rtw_resume_process(padapter);
}
else
{
ret = rtw_resume_process(padapter);
}
}It does not matter if the conditions are true or not, ret is always set to:
ret = rtw_resume_process(padapter)
Is this a bug or is the if else construct just pointless?
Regards,
Michael
Hi,
Quoted 21 lines · Michael Straube
Hi,
I stumbled upon the following if else construct in
drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618if (
pwrpriv->bInternalAutoSuspend)
{
ret =rtw_resume_process(padapter);
}
else
{
if (pwrpriv->wowlan_mode||pwrpriv->wowlan_ap_mode) {
ret =rtw_resume_process(padapter); }
else
{
ret =rtw_resume_process(padapter); }
}
Quoted 6 lines
It does not matter if the conditions are true or not, ret is always set to:
ret =
rtw_resume_process(padapter)Is this a bug or is the if else construct just pointless?
It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away.
Regards,
Hans
Quoted 28 lines · Hans de Goede
Hi,
Quoted 25 lines · Michael Straube
Hi,
I stumbled upon the following if else construct in
drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv-Quoted 1 line
wowlan_ap_mode){ ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } }It does not matter if the conditions are true or not, ret is always set to:
Quoted 7 lines
Quoted 3 lines
ret =
rtw_resume_process(padapter)Is this a bug or is the if else construct just pointless?
It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away.
Quoted 31 lines · Bastien Nocera
Quoted 30 lines · Hans de Goede
Hi,
Quoted 27 lines · Michael Straube
Hi,
I stumbled upon the following if else construct in
drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv-Quoted 1 line
wowlan_ap_mode){ ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } }It does not matter if the conditions are true or not, ret is always set to:
ret =
rtw_resume_process(padapter)
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
Is this a bug or is the if else construct just pointless?
It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away.
So it can be safly removed?
Hi,
Quoted 38 lines · Michael Straube
Quoted 37 lines · Bastien Nocera
Quoted 35 lines · Hans de Goede
Hi,
Quoted 22 lines · Michael Straube
Hi,
I stumbled upon the following if else construct in
drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618if (
pwrpriv->bInternalAutoSuspend) {
ret =rtw_resume_process(padapter); }
else
{
if (pwrpriv->wowlan_mode|| pwrpriv-Quoted 1 line
wowlan_ap_mode){
ret =rtw_resume_process(padapter); }
else
{
ret =rtw_resume_process(padapter); }
}Quoted 6 lines
It does not matter if the conditions are true or not, ret is always set to:
ret =
rtw_resume_process(padapter)Is this a bug or is the if else construct just pointless?
It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away.
Quoted 5 lines
Quoted 3 lines
So it can be safly removed?
Simplified to a single:
ret = rtw_resume_process(padapter);
Yes that should be fine.
Regards,
Hans
Quoted 10 lines · Bastien Nocera
Quoted 6 lines · Hans de Goede
Quoted 2 lines · Michael Straube
ret =
rtw_resume_process(padapter)
Is this a bug or is the if else construct just pointless?It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away.
That #ifdef forest is/was quite unsightly.
No wonder the realtek code is unmaintainable.
Quoted 21 lines · Michael Straube
Hi,
I stumbled upon the following if else construct in
drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode) { ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } }
Quoted 6 lines
It does not matter if the conditions are true or not, ret is always set to:
ret =
rtw_resume_process(padapter)Is this a bug or is the if else construct just pointless?
Looks pretty pointless...