Staging: fix coding style in rtl8188eu/core
PATCH 1/1 Staging: fix coding style in rtl8188eu/core
Set constant on the left of the test, and jump a new line to avoid to exceed the 80 char length limit.
--- drivers/staging/rtl8188eu/core/rtw_iol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_iol.c +3 -2
@@ -22,10 +22,11 @@bool rtw_IOL_applied (struct adapter *adapter) { -if (1 == adapter->registrypriv.fw_iol) +if (adapter->registrypriv.fw_iol ==1 )return true; -if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj (adapter)->ishighspeed)) +if ((adapter->registrypriv.fw_iol ==2 ) + && (!adapter_to_dvobj (adapter)->ishighspeed))return true;return false; }
Signature · 1 line
2.5.0
Quoted 2 lines · Colin Vidal
Set constant on the left of the test, and jump a new line to avoid to exceed the 80 char length limit.
[]
drivers/staging/rtl8188eu/core/rtw_iol.c
Quoted 1 line
drivers/staging/rtl8188eu/core/rtw_iol.c +0
-0
[]
Quoted 11 lines
drivers/staging/rtl8188eu/core/rtw_iol.c +0
-0@@ -22,10 +22,11 @@
boolrtw_IOL_applied(struct adapter *adapter)
{drivers/staging/rtl8188eu/core/rtw_iol.c +1
-1-if (1 == adapter->registrypriv.fw_iol) +if (adapter->registrypriv.fw_iol ==1 )return true;
drivers/staging/rtl8188eu/core/rtw_iol.c +2
-1-if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj (adapter)->ishighspeed)) +if ((adapter->registrypriv.fw_iol ==2 ) + && (!adapter_to_dvobj(adapter)->ishighspeed))
Quoted 3 lines
return true;
return false;
}
Please review your patches with scripts/checkpatch.pl
Perhaps this is better as:
bool rtw_IOL_applied(struct adapter *adapter)
{
if (adapter->registrypriv.fw_iol == 1)
return true;
if (adapter->registrypriv.fw_iol == 2 &&
!adapter_to_dvobj(adapter)->ishighspeed)
return true;
return false;
}or maybe even
bool rtw_IOL_applied(struct adapter *adapter)
{
return adapter->registrypriv.fw_iol == 1 ||
(adapter->registrypriv.fw_iol == 2 &&
!adapter_to_dvobj(adapter)->ishighspeed);
}Quoted 40 lines · Joe Perches
Quoted 3 lines · Colin Vidal
Set constant on the left of the test, and jump a new line to avoid to
exceed the 80 char length limit.[]
drivers/staging/rtl8188eu/core/rtw_iol.c
Quoted 2 lines
drivers/staging/rtl8188eu/core/rtw_iol.c +0
-0[]
Quoted 12 lines
drivers/staging/rtl8188eu/core/rtw_iol.c +0
-0@@ -22,10 +22,11 @@
boolrtw_IOL_applied(struct adapter *adapter)
{drivers/staging/rtl8188eu/core/rtw_iol.c +1
-1-if (1 == adapter->registrypriv.fw_iol) +if (adapter->registrypriv.fw_iol ==1 )return true;
drivers/staging/rtl8188eu/core/rtw_iol.c +0
-1- if ((2 == adapter->registrypriv.fw_iol) &&(!adapter_to_dvobj(adapter)->ishighspeed))
drivers/staging/rtl8188eu/core/rtw_iol.c +2
-0+if ((adapter->registrypriv.fw_iol ==2 ) + && (!adapter_to_dvobj(adapter)->ishighspeed))Quoted 3 lines
return true;
return false;
}Please review your patches with
scripts/checkpatch.plPerhaps this is better as:
bool
rtw_IOL_applied(struct adapter *adapter){ if (adapter->registrypriv.fw_iol == 1) return true; if (adapter->registrypriv.fw_iol == 2 && !adapter_to_dvobj(adapter)->ishighspeed) return true; return false; }
Quoted 9 lines
or maybe even
bool
rtw_IOL_applied(struct adapter *adapter){ return adapter->registrypriv.fw_iol == 1 || (adapter->registrypriv.fw_iol == 2 && !adapter_to_dvobj(adapter)->ishighspeed); }
Oh, yeah, the second one is obviously finer. If I'm right, I should resend a new patch with a subject which looks something like "[PATCH v2] ... " ?
Thanks
Quoted 6 lines · Colin Vidal
Quoted 5 lines · Joe Perches
Quoted 2 lines · Colin Vidal
Set constant on the left of the test, and jump a new line to avoid to exceed the 80 char length limit.
[]
drivers/staging/rtl8188eu/core/rtw_iol.c
Quoted 1 line
drivers/staging/rtl8188eu/core/rtw_iol.c +0
-0
[]
Quoted 11 lines
Quoted 7 lines
bool
rtw_IOL_applied(struct adapter *adapter){ return adapter->registrypriv.fw_iol == 1 || (adapter->registrypriv.fw_iol == 2 && !adapter_to_dvobj(adapter)->ishighspeed); }Oh, yeah, the second one is obviously finer. If I'm right, I should resend a new patch with a subject which looks something like "[PATCH v2] ... " ?
correct.