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>
T24gVHVlc2RheSAyMiBBdWd1c3QgMjAwNiAxNDo1MywgSmFuLUJlcm5kIFRoZW1hbm4gd3JvdGU6
Cj4gK6CgoKCgoKB1NjQgcnBhZ2UgPSAwOwo+ICugoKCgoKCgaW50IHJldDsKPiAroKCgoKCgoGlu
dCBjbnQgPSAwOwo+ICugoKCgoKCgdm9pZCAqdnBhZ2UgPSBOVUxMOwo+ICsKPiAroKCgoKCgoHJl
dCA9IGh3X3F1ZXVlX2N0b3IoaHdfcXVldWUsIG5yX3BhZ2VzLCBFSEVBX1BBR0VTSVpFLCB3cWVf
c2l6ZSk7Cj4gK6CgoKCgoKBpZiAocmV0KQo+ICugoKCgoKCgoKCgoKCgoKByZXR1cm4gcmV0Owo+
ICsKPiAroKCgoKCgoGZvciAoY250ID0gMDsgY250IDwgbnJfcGFnZXM7IGNudCsrKSB7Cj4gK6Cg
oKCgoKCgoKCgoKCgoHZwYWdlID0gaHdfcXBhZ2VpdF9nZXRfaW5jKGh3X3F1ZXVlKTsKPiAroKCg
oKCgoKCgoKCgoKCgaWYgKCF2cGFnZSkgewo+ICugoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGVoZWFf
ZXJyb3IoImh3X3FwYWdlaXRfZ2V0X2luYyBmYWlsZWQiKTsKPiAroKCgoKCgoKCgoKCgoKCgoKCg
oKCgoKBnb3RvIHFwX2FsbG9jX3JlZ2lzdGVyX2V4aXQwOwo+ICugoKCgoKCgoKCgoKCgoKB9Cj4g
K6CgoKCgoKCgoKCgoKCgoHJwYWdlID0gdmlydF90b19hYnModnBhZ2UpOwoKQXMgc29tZW9uZSBt
ZW50aW9uZWQgYmVmb3JlLCB0aGUgaW5pdGlhbGl6YXRpb24gdG8gMCBvciBOVUxMCmlzIHBvaW50
bGVzcyBoZXJlLCBhcyB0aGUgdmFyaWFibGVzIGFyZSBhbHdheXMgYXNzaWduZWQgYmVmb3JlCnRo
ZXkgYXJlIHVzZWQuIFRoZXJlIGFyZSBhIG51bWJlciBvZiBvdGhlciBwbGFjZXMgaW4geW91cgpj
b2RlIHRoYXQgZG8gc2ltaWxhciB0aGluZ3MsIHlvdSBzaG91bGQgcHJvYmFibHkgZ28gdGhyb3Vn
aAp0aGVzZSBhbmQgcmVtb3ZlIHRoZSBpbml0aWFsaXplcnMuCgpJZiB5b3UgaW5kZWVkIG5lZWQg
c29tZXRoaW5nIHRvIGJlIGluaXRpYWxpemVkLCBpdCBpcyBnb29kIHByYWN0aWNlCnRvIGRvIHRo
ZSBpbml0aWFsaXphdGlvbiBhcyBsYXRlIGFzIHBvc3NpYmxlLCBlLmcuCgoJaW50IGZvbzsKCS4u
LgoJZm9vID0gMDsKCWRvX2Zvbyhmb28pOwoKdG8gbWFrZSBpdCBjbGVhciB0aGF0IHlvdSBoYXZl
IGEgcmVhc29uIHRvIGluaXRpYWxpemUgaXQuCgoJQXJuZCA8PjwK
WARNING: multiple messages have this Message-ID (diff)
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 <><
next prev parent reply other threads:[~2006-08-22 14:01 UTC|newest]
Thread overview: 28+ 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 12:53 ` Jan-Bernd Themann
2006-08-22 14:01 ` Arnd Bergmann [this message]
2006-08-22 14:01 ` Arnd Bergmann
2006-08-22 13:51 ` Jan-Bernd Themann
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-06 13:32 ` Jan-Bernd Themann
2006-09-04 10:39 Jan-Bernd Themann
2006-09-04 10:39 ` Jan-Bernd Themann
2006-08-23 8:57 Jan-Bernd Themann
2006-08-23 8:57 ` Jan-Bernd Themann
2006-08-18 11:31 Jan-Bernd Themann
2006-08-18 11:31 ` Jan-Bernd Themann
2006-08-18 12:17 ` Arjan van de Ven
2006-08-18 12:17 ` Arjan van de Ven
2006-08-18 13:25 ` Thomas Klein
2006-08-18 13:25 ` Thomas Klein
2006-08-18 13:47 ` Arnd Bergmann
2006-08-18 13:47 ` Arnd Bergmann
2006-08-18 14:24 ` Christoph Raisch
2006-08-18 14:24 ` Christoph Raisch
2006-08-18 16:16 ` Arnd Bergmann
2006-08-18 16:16 ` Arnd Bergmann
2006-08-18 14:33 ` Jörn Engel
2006-08-18 14:33 ` Jörn Engel
2006-08-18 14:40 ` 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.