Re: [PATCH] Staging: rtl8192e: fix line length coding style issue in rtllib_softmac.c
From: Joe Perches
Date: Fri Mar 18 2016 - 14:04:11 EST
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.