Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360852
| From | Joe Perches <joe@perches.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Staging: rtl8192e: fix line length coding style issue in rtllib_softmac.c |
| Date | 2016-03-18 19:10 +0100 |
| Message-ID | <re70u-49j-13@gated-at.bofh.it> (permalink) |
| References | <re6H8-3uY-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] Staging: rtl8192e: fix line length coding style issue in rtllib_softmac.c Yousof El-Sayed <yousof.el-sayed@elastichosts.com> - 2016-03-18 18:50 +0100 Re: [PATCH] Staging: rtl8192e: fix line length coding style issue in rtllib_softmac.c Joe Perches <joe@perches.com> - 2016-03-18 19:10 +0100
csiph-web