lkml.org 
[lkml]   [2016]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] Staging: rtl8192e: fix line length coding style issue in rtllib_softmac.c
From
Date
On Fri, 2016-03-18 at 17:48 +0000, Yousof El-Sayed wrote:
> This is a patch to the rtllib_softmac.c file that fixes up all instances of
>  the 'line over 80 characters' warnings found by the checkpatch.pl tool.
[]
> diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
[]
> @@ -389,7 +389,8 @@ static void rtllib_send_beacon(struct rtllib_device *ieee)
>  
>   if (ieee->beacon_txing && ieee->ieee_up)
>   mod_timer(&ieee->beacon_timer, jiffies +
> -   (msecs_to_jiffies(ieee->current_network.beacon_interval - 5)));
> +   (msecs_to_jiffies
> +    (ieee->current_network.beacon_interval - 5)));

Long identifier names like "current_network.beacon_interval",
which is 31 chars long, make the 80 column limit somewhat silly.

It's OK to ignore checkpatch warnings when changing the code
is less readable.

Most all of these are less nice than the original.

For instance, if this were to be changed (and it doesn't
need to be) perhaps:

>   if (ieee->beacon_txing && ieee->ieee_up)
>   mod_timer(&ieee->beacon_timer, jiffies +
> -   (msecs_to_jiffies(ieee->current_network.beacon_interval - 5)));
> +   (msecs_to_jiffies
> +    (ieee->current_network.beacon_interval - 5)));


mod_timer(&ieee->beacon_timer,
jiffies +
msecs_to_jiffies(ieee->current_network.beacon_interval - 5));
which is still > 80 columns, but it removes an unnecessary
set of parentheses.
Breaking the msecs_to_jiffies() at the function name is
otherwise rather unsightly.

Always strive for readability and clarity over serving
some mindless script.

\
 
 \ /
  Last update: 2016-03-18 19:41    [W:0.028 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site