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:	Sun, 4 Feb 2007 01:22:59 +0100 (CET)
From:	Tim Schmielau <tim@...sik3.uni-rostock.de>
To:	"Ahmed S. Darwish" <darwish.07@...il.com>
cc:	Richard Knutsson <ricknu-0@...dent.ltu.se>,
	linux-kernel@...r.kernel.org, randy.dunlap@...cle.com
Subject: Re: A CodingStyle suggestion

On Sun, 4 Feb 2007, Ahmed S. Darwish wrote:
> On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote:
> > So:
> > 
> > if (is_true()) {
> > 	/* do something */
> > }
> > 
> > is alright then? If so, I agree, but please make it real clear in the 
> > document ;)
> 
> Good catch :). A small grep of `access_ok' reveals that it's always used in the 
> form of:
> if (!access_ok()) { .. }
> 
> I can conclude that verbal/imperative methods like `kmalloc, add_work' be 
> checked as:
> ret = do_work();
> if (ret) { ... }
> and predicate methods like `acess_ok, pci_dev_present' be checked like:
> if (!access_ok) { ... }
> if (pci_dev_present) { ...}

Maybe say that any functions with a side effect should be called on a line 
by themselves?

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