lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Staging: fix coding style in rtl8188eu/core
From
Date
On Tue, 2016-02-02 at 21:57 +0100, Colin Vidal wrote:
> Set constant on the left of the test, and jump a new line to avoid to
> exceed the 80 char length limit.
[]
> diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c b/drivers/staging/rtl8188eu/core/rtw_iol.c
[]
> @@ -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;
>  }

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);
}

\
 
 \ /
  Last update: 2016-02-02 23:01    [W:0.040 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site