public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: linux-kernel@vger.kernel.org
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>,
	Michael Krufky <mkrufky@linuxtv.org>,
	v4l-dvb maintainer list <v4l-dvb-maintainer@linuxtv.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [v4l-dvb-maintainer] [PULL] http://linuxtv.org/hg/~mcisely/pvrusb2
Date: Fri, 05 Sep 2008 17:02:35 -0400	[thread overview]
Message-ID: <48C19E6B.2090505@tmr.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0809020933001.11377@cnc.isely.net>

Mike Isely wrote:

>> If you need this kind of safety measures against errors in future code
>> changes, could it be that you have some general QA problems?

That's always a problem with humans in the loop. I very much agree that 
one line or three is far safer against a hasty line insertion than only two.

In my own code I write one if it fits, three if it doesn't. Being easy 
to read is good, being hard to misread is better.
> 
> One of the points behind a good coding style is that it should encourage 
> code that is robust against trivial mistakes.  Prefering
> 
> 	if (a) {
> 		b;
> 	}
> 
> over
> 
> 	if (a)
> 		b;
> 
> I consider to be an example of this kind of simple safety.  (And I have 
> in the past seen people getting burned from the obvious error of 
> sticking a debug printf in between.)  ACTUALLY, I'd much, much rather 
> prefer
> 
> 	if (a) b;
> 
> however checkpatch.pl gets angry about that as well (even though the 
> kernel CodingStyle document would seem to actually allow this - it's 
> still one statement and since "b" is outside the normal flow then it's 
> "something to hide" and should be ok in any case).
> 
> 
>> (However, why waste time arguing over braces or not?)
> 
> Tell that to those who would use checkpatch.pl to gate incoming 
> changesets.
> 

-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot


      reply	other threads:[~2008-09-05 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.64.0808312020060.16986@cnc.isely.net>
     [not found] ` <20080902061821.4df5cba4@mchehab.chehab.org>
     [not found]   ` <Pine.LNX.4.64.0809020815060.16986@cnc.isely.net>
2008-09-02 13:29     ` [v4l-dvb-maintainer] [PULL] http://linuxtv.org/hg/~mcisely/pvrusb2 Michael Krufky
2008-09-02 14:29       ` Stefan Richter
2008-09-03  0:04         ` Mike Isely
2008-09-05 21:02           ` Bill Davidsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C19E6B.2090505@tmr.com \
    --to=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mkrufky@linuxtv.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox