Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934039AbbFWON5 (ORCPT ); Tue, 23 Jun 2015 10:13:57 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:38345 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933982AbbFWONk (ORCPT ); Tue, 23 Jun 2015 10:13:40 -0400 Date: Tue, 23 Jun 2015 16:19:37 +0200 From: Luis de Bethencourt To: Frans Klaver Cc: "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Antoine Schweitzer-Chaput , Cristina Opriceana , Aya Mahfouz , Rickard Strandqvist , Koray Gulcu , Greg Donald , Lorenzo Stoakes , Ebru Akagunduz , Karthik Nayak , devel@driverdev.osuosl.org Subject: Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons Message-ID: <20150623141937.GA5328@goodgumbo.baconseed.org> References: <20150623125224.GA991@goodgumbo.baconseed.org> <20150623132123.GA2225@goodgumbo.baconseed.org> <20150623135923.GA4297@goodgumbo.baconseed.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3460 Lines: 78 On Tue, Jun 23, 2015 at 03:59:41PM +0200, Frans Klaver wrote: > On Tue, Jun 23, 2015 at 3:59 PM, Luis de Bethencourt > wrote: > > On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote: > >> On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt > >> wrote: > >> > >> >> > if (dm_digtable.dig_algorithm_switch) { > >> >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device *dev) > >> >> > priv->bDynamicTxLowPower = false; > >> >> > } else { > >> >> > /* high power state check */ > >> >> > - if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && priv->bDynamicTxHighPower == true) > >> >> > + if (priv->undecorated_smoothed_pwdb < > >> >> > + txlowpower_threshold && priv->bDynamicTxHighPower) > >> >> > priv->bDynamicTxHighPower = false; > >> >> > >> >> Oh, this has a misleading air hanging over it. It focuses the eyes on > >> >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that > >> >> probably isn't the intent. > >> >> > >> >> Frans > >> > > >> > I agree, and wasn't sure what the best way to deal with was. > >> > > >> > The following doesn't mislead but goes above 80 characters. > >> > if (priv->undecorated_smoothed_pwdb < txlowpower_threshold && > >> > priv->bDynamicTxHighPower == true) > >> > > >> > It is better than the original but it doesn't completely fix it. > >> > > >> > If this is a better compromise I can update the patch. > >> > >> If we keep people's internal parsers working properly, I think having > >> a line of three characters too long is a fair compromise. Besides > >> that, there are a lot more lines of code in that file that need to be > >> brought back to under 80 characters. > >> > >> If you really care about that line length, precede with a patch (or > >> two) that changes those insanely long (local!) variable names, so that > >> you can break up the line right away. > >> > >> Have fun, > >> Frans > > > > Very true. There are a *lot* of massively long lines. > > > > This has been a learning experience. I wasn't sure how strict the rules for > > submissions were. > > Well, as far as I know "Don't break internal parsers" wins over > "Checkpatch complains". However, checkpatch usually does have a nose > for smelly code (as does sparse, btw), so it pays to look around a bit > if it complains. In the end the maintainer decides whether a patch > passes the criteria. > Even if analyzers miss things and give false positives, they are interesting tools to find interesting code to read and maybe double-check things before submitting. > > There are other things besides line lengths that I want to fix in > > rtl8192u. Related to that, I just sent a 3rd version which includes fixes for > > these bool comparisons for the rest of the files in drivers/staging/rtl8192u/ > > > > Thanks so much for taking the time to review. Appreciated. > > No problem. Was waiting for a yocto build to finish anyway. > > Frans Have fun with yocto! Luis -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/