mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Heiko J Schick <schihei@de.ibm.com>
Cc: openib-general@openib.org, Christoph Raisch <RAISCH@de.ibm.com>,
	Hoang-Nam Nguyen <HNGUYEN@de.ibm.com>,
	Marcus Eder <MEDER@de.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 02/16] ehca: module infrastructure
Date: Thu, 27 Apr 2006 14:09:51 +0200	[thread overview]
Message-ID: <20060427120951.GE32127@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <4450A165.4000701@de.ibm.com>

On Thu, 27 April 2006 12:48:05 +0200, Heiko J Schick wrote:
>
> +	if (ehca_module->cache_pd == NULL) {

Hmm.

> +	ret = kmem_cache_destroy(ehca_module->cache_pd);
> +	if (ret != 0)

The " != 0" is completely superfluous.  Above NULL check is a matter
of taste, this one demonstates lack of boolean algebra understanding.

> +	rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
> +	if (!rblock) {

Hmm.  And your taste seems to change. :)

> +	if (ehca_hw_level == 0) {

And since we're on the subject.  Ignoring the recent discussion
involving akpm, viro and others, the kernel historically used int both
for integer and boolean, plus return values as a special kind of
"boolean with error indication attached".

For boolean, it is nicer to do things like "if (!error)", for
integers, a comparison as above is nicer.  Return codes fall into the
boolean category.  Pointers after kmalloc() and similar are viewed as
rich boolean by some people, but not by all.

Jörn

-- 
Geld macht nicht glücklich.
Glück macht nicht satt.

  reply	other threads:[~2006-04-27 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 10:48 Heiko J Schick
2006-04-27 12:09 ` Jörn Engel [this message]
2006-04-27 15:29 ` Heikki Orsila

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=20060427120951.GE32127@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=HNGUYEN@de.ibm.com \
    --cc=MEDER@de.ibm.com \
    --cc=RAISCH@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=openib-general@openib.org \
    --cc=schihei@de.ibm.com \
    /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

all inboxes | Powered by JetHome®