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]
Message-ID: <20071018111352.GA17039@elte.hu>
Date:	Thu, 18 Oct 2007 13:13:52 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Andy Whitcroft <apw@...dowen.org>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: latest checkpatch


latest checkpatch.pl works really well on sched.c.

there's only one problem left, this bogus false positive warning 
reappeared:

  WARNING: braces {} are not necessary for single statement blocks
  #5710: FILE: sched.c:5710:
  +       if (parent->groups == parent->groups->next) {
  +               pflags &= ~(SD_LOAD_BALANCE |
  +                               SD_BALANCE_NEWIDLE |
  +                               SD_BALANCE_FORK |
  +                               SD_BALANCE_EXEC |
  +                               SD_SHARE_CPUPOWER |
  +                               SD_SHARE_PKG_RESOURCES);
  +       }

(there's another place in sched.c that trips this up too.)

i think it has been pointed out numerous times that it is perfectly fine 
to use curly braces for multi-line single-statement blocks. That 
includes simple cases like this too:

	if (x) {
		/* do y() */
		y();
	}

it's perfectly legitimate, in fact more robust. So if checkpatch.pl 
wants to make any noise about such constructs it should warn about the 
_lack_ of curly braces in every multi-line condition block _except_ the 
only safe single-line statement:

	if (x)
		y();

thanks,

	Ingo
-
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