lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 30 Oct 2010 18:38:59 -0700
From:	Joe Perches <joe@...ches.com>
To:	Michael Cree <mcree@...on.net.nz>
Cc:	Matt Turner <mattst88@...il.com>, Jiri Kosina <trivial@...nel.org>,
	Richard Henderson <rth@...ddle.net>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/39] arch/alpha: Update WARN uses

On Sun, 2010-10-31 at 14:11 +1300, Michael Cree wrote:
> On 31/10/10 10:28, Joe Perches wrote:
> > On Sat, 2010-10-30 at 17:17 -0400, Matt Turner wrote:
> >> On Sat, Oct 30, 2010 at 5:08 PM, Joe Perches<joe@...ches.com>  wrote:
> >>> Coalesce long formats.
> >>> Align arguments.
> >> What's accomplished here? It looks like you joined two strings (which
> >> were separated as to not overflow the 80-char limit) and spaced a
> >> couple lines over.
> > This one is just a whitespace cleanup.
> > Ignore it or nack it if you want.
> I prefer the original indenting as it clearly stands the `1' on its own 
> thus emphasising that the warning will be printed everytime the WARN() 
> statement is executed.  I surmise that the original programmer thought 
> it important to emphasise this as it might not be considered the 
> "normal" usage of WARN().

Actually, WARN(1, foo) is by far the most common use of WARN.
More than half of all uses.

$ grep -rP --include=*.[ch] -oh "\bWARN\s*\(" * | wc -l
286
$ grep -rP --include=*.[ch] -oh "\bWARN\s*\(\w+" * | \
	sort | uniq -c | sort -rn | head -5
    173 WARN(1
      8 WARN(IS_ERR
      4 WARN(ret
      4 WARN(priv
      4 WARN(local

> The moral here is that when a _competent_ programmer breaks the "style 
> guide" they are most likely doing so for a very good reason.  Thus, 
> those who would submit whitespace fix patches should take time to ask 
> themselves why the original programmer has laid out the code in such a 
> fashion and learn from it, before submitting so-called "fixes".

Code is decidedly not music.

This stuff is mostly craft not art and consistency in
craft has value.

You might also note I didn't call it a fix, I called it
a whitespace cleanup.

And again, I don't much care if it's applied to
arch/alpha or not.  I haven't had an alpha since I gave
away my AlphaStation a decade ago.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ