Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Oct 2009 04:20:22 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Coleman Kane <cokane@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= <des@des.no>, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: svn commit: r197654 - head/sys/dev/if_ndis
Message-ID:  <20091002040903.U21917@delplex.bde.org>
In-Reply-To: <1254418346.4255.31.camel@localhost>
References:  <200910010243.n912hpSM034846@svn.freebsd.org> <86eipno12p.fsf@ds4.des.no> <20091002002534.D21507@delplex.bde.org> <1254418346.4255.31.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-971013447-1254421222=:21917
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 1 Oct 2009, Coleman Kane wrote:

> On Fri, 2009-10-02 at 00:36 +1000, Bruce Evans wrote:
>> On Thu, 1 Oct 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:
>>
>>> Coleman Kane <cokane@FreeBSD.org> writes:
>>>> -=09=09if (sc->ndis_80211 && vap)
>>>> +=09=09if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
>>>
>>> sc->ndis_80211 is an int.  NULL is a pointer.
>>
>> Also, the number of style bugs was doubled on (almost?) every changed li=
ne
>> by adding 2 sets of unnecessary parentheses.
>>
>> Bruce
>
> Re-read style(9) more closely.

Do I need to read it at all :-).

> Yes... the extra parentheses are superfluous, and should therefore be
> removed. However, the current rev, which looks like this:
>
>  if ((sc->ndis_80211 !=3D 0) && (vap !=3D NULL))
>
> doesn't help the author shoot themselves in the foot as violating the
> "explicitly compare values to zero" rule did in the earlier revision.

Actually I needed to count the style bugs more carefully -- 2 implicit
comparisons with 0 or NULL (unless the first one is really boolean),
but I only counted 1, while I counted 2 for the extra parentheses.

> I'll heed the request of the second-to-last paragraph of style(9) on
> this particular change, not churning the SVN repo further, and make a
> mental note for later.

Thanks.  I forgot about that paragraph being there.  I think churning
repos doesn't matter much now if it ever did, but churning sources makes
their history hard to understand.

Bruce
--0-971013447-1254421222=:21917--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091002040903.U21917>