From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e5.ny.us.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTP id 97F5F67C71 for ; Wed, 23 Aug 2006 00:01:31 +1000 (EST) Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k7ME1SnJ029163 for ; Tue, 22 Aug 2006 10:01:28 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k7ME1QgP279172 for ; Tue, 22 Aug 2006 10:01:26 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k7ME1Pat031427 for ; Tue, 22 Aug 2006 10:01:25 -0400 From: Arnd Bergmann To: Jan-Bernd Themann Subject: Re: [2.6.19 PATCH 3/7] ehea: queue management Date: Tue, 22 Aug 2006 16:01:24 +0200 References: <200608221453.49667.ossthema@de.ibm.com> In-Reply-To: <200608221453.49667.ossthema@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200608221601.24882.arnd.bergmann@de.ibm.com> Cc: Thomas Klein , Jan-Bernd Themann , netdev , linux-kernel , linux-ppc , Christoph Raisch , Marcus Eder List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , T24gVHVlc2RheSAyMiBBdWd1c3QgMjAwNiAxNDo1MywgSmFuLUJlcm5kIFRoZW1hbm4gd3JvdGU6 Cj4gK6CgoKCgoKB1NjQgcnBhZ2UgPSAwOwo+ICugoKCgoKCgaW50IHJldDsKPiAroKCgoKCgoGlu dC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kZWVkIG5lZWQg c29tZXRoaW5nIHRvIGJlIGluaXRpYWxpemVkLCBpdCBpcyBnb29kIHByYWN0aWNlCnRvIGRvIHRo ZSBpbml0aWFsaXphdGlvbiBhcyBsYXRlIGFzIHBvc3NpYmxlLCBlLmcuCgoJaW50IGZvbzsKCS4u LgoJZm9vID0gMDsKCWRvX2Zvbyhmb28pOwoKdG8gbWFrZSBpdCBjbGVhciB0aGF0IHlvdSBoYXZl IGEgcmVhc29uIHRvIGluaXRpYWxpemUgaXQuCgoJQXJuZCA8PjwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [2.6.19 PATCH 3/7] ehea: queue management Date: Tue, 22 Aug 2006 16:01:24 +0200 Message-ID: <200608221601.24882.arnd.bergmann@de.ibm.com> References: <200608221453.49667.ossthema@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: Thomas Klein , Jan-Bernd Themann , netdev , linux-kernel , linux-ppc , Christoph Raisch , Marcus Eder Return-path: To: Jan-Bernd Themann In-Reply-To: <200608221453.49667.ossthema@de.ibm.com> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org Errors-To: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org List-Id: netdev.vger.kernel.org On Tuesday 22 August 2006 14:53, Jan-Bernd Themann wrote: > +=A0=A0=A0=A0=A0=A0=A0u64 rpage =3D 0; > +=A0=A0=A0=A0=A0=A0=A0int ret; > +=A0=A0=A0=A0=A0=A0=A0int cnt =3D 0; > +=A0=A0=A0=A0=A0=A0=A0void *vpage =3D NULL; > + > +=A0=A0=A0=A0=A0=A0=A0ret =3D hw_queue_ctor(hw_queue, nr_pages, EHEA_PAGE= SIZE, wqe_size); > +=A0=A0=A0=A0=A0=A0=A0if (ret) > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return ret; > + > +=A0=A0=A0=A0=A0=A0=A0for (cnt =3D 0; cnt < nr_pages; cnt++) { > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0vpage =3D hw_qpageit_get_in= c(hw_queue); > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if (!vpage) { > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0ehe= a_error("hw_qpageit_get_inc failed"); > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0got= o qp_alloc_register_exit0; > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0} > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0rpage =3D 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 =3D 0; do_foo(foo); to make it clear that you have a reason to initialize it. Arnd <><