netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd.bergmann@de.ibm.com>
To: Jan-Bernd Themann <ossthema@de.ibm.com>
Cc: Thomas Klein <tklein@de.ibm.com>,
	Jan-Bernd Themann <themann@de.ibm.com>,
	netdev <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-ppc <linuxppc-dev@ozlabs.org>,
	Christoph Raisch <raisch@de.ibm.com>,
	Marcus Eder <meder@de.ibm.com>
Subject: Re: [2.6.19 PATCH 3/7] ehea: queue management
Date: Tue, 22 Aug 2006 16:01:24 +0200	[thread overview]
Message-ID: <200608221601.24882.arnd.bergmann@de.ibm.com> (raw)
In-Reply-To: <200608221453.49667.ossthema@de.ibm.com>

On Tuesday 22 August 2006 14:53, Jan-Bernd Themann wrote:
> +       u64 rpage = 0;
> +       int ret;
> +       int cnt = 0;
> +       void *vpage = NULL;
> +
> +       ret = hw_queue_ctor(hw_queue, nr_pages, EHEA_PAGESIZE, wqe_size);
> +       if (ret)
> +               return ret;
> +
> +       for (cnt = 0; cnt < nr_pages; cnt++) {
> +               vpage = hw_qpageit_get_inc(hw_queue);
> +               if (!vpage) {
> +                       ehea_error("hw_qpageit_get_inc failed");
> +                       goto qp_alloc_register_exit0;
> +               }
> +               rpage = virt_to_abs(vpage);

As someone mentioned before, the initialization to 0 or NULL
is pointless here, as the variables are always assigned before
they are used. There are a number of other places in your
code that do similar things, you should probably go through
these and remove the initializers.

If you indeed need something to be initialized, it is good practice
to do the initialization as late as possible, e.g.

	int foo;
	...
	foo = 0;
	do_foo(foo);

to make it clear that you have a reason to initialize it.

	Arnd <><

  reply	other threads:[~2006-08-22 14:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-22 12:53 [2.6.19 PATCH 3/7] ehea: queue management Jan-Bernd Themann
2006-08-22 14:01 ` Arnd Bergmann [this message]
2006-08-22 13:51   ` Jan-Bernd Themann
  -- strict thread matches above, loose matches on Subject: below --
2006-09-06 13:32 Jan-Bernd Themann
2006-09-04 10:39 Jan-Bernd Themann
2006-08-23  8:57 Jan-Bernd Themann
2006-08-18 11:31 Jan-Bernd Themann
2006-08-18 12:17 ` Arjan van de Ven
2006-08-18 13:25   ` Thomas Klein
2006-08-18 13:47     ` Arnd Bergmann
2006-08-18 14:24       ` Christoph Raisch
2006-08-18 16:16         ` Arnd Bergmann
2006-08-18 14:33     ` Jörn Engel
2006-08-18 14:40 ` Jörn Engel

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=200608221601.24882.arnd.bergmann@de.ibm.com \
    --to=arnd.bergmann@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=meder@de.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=ossthema@de.ibm.com \
    --cc=raisch@de.ibm.com \
    --cc=themann@de.ibm.com \
    --cc=tklein@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;
as well as URLs for NNTP newsgroup(s).