From: Chris Wright <chrisw@osdl.org>
To: Hua Zhong <hzhong@cisco.com>
Cc: "'Chris Wright'" <chrisw@osdl.org>,
linux-kernel@vger.kernel.org, greg@kroah.com, torvalds@osdl.org,
akpm@osdl.org
Subject: Re: Linux 2.6.11.6
Date: Fri, 25 Mar 2005 19:58:46 -0800 [thread overview]
Message-ID: <20050326035846.GX30522@shell0.pdx.osdl.net> (raw)
In-Reply-To: <200503260347.AXR12129@mira-sjc5-e.cisco.com>
* Hua Zhong (hzhong@cisco.com) wrote:
> > int bt_sock_unregister(int proto)
> > {
> > - if (proto >= BT_MAX_PROTO)
> > + if (proto < 0 || proto >= BT_MAX_PROTO)
> > return -EINVAL;
>
> Just curious: would it be better to say
>
> if ((unsigned int)proto >= BT_MAX_PTORO)
the first check makes it painfully obvious what it's checking. i think
it's a wash (-O2 seems to collapse to the same check), with a win for
readability.
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
next prev parent reply other threads:[~2005-03-26 4:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050326024616.GM28536@shell0.pdx.osdl.net>
2005-03-26 3:39 ` Linux 2.6.11.6 Chris Wright
2005-03-26 3:41 ` Chris Wright
2005-03-26 3:47 ` Hua Zhong
2005-03-26 3:56 ` Kyle Moffett
2005-03-26 3:58 ` Chris Wright [this message]
2005-03-26 8:50 ` Moritz Muehlenhoff
2005-03-26 9:27 ` Chris Wright
2005-03-27 18:52 ` Ryan Anderson
2005-03-27 18:59 ` Dave Jones
2005-03-27 19:59 ` Chris Wright
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=20050326035846.GX30522@shell0.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=hzhong@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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