From owner-cvs-all Thu Jan 16 11:21:35 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D789037B401; Thu, 16 Jan 2003 11:21:33 -0800 (PST) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04F3743F13; Thu, 16 Jan 2003 11:21:33 -0800 (PST) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (hiten@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.7/8.12.1) with ESMTP id h0GJLPa6025426; Thu, 16 Jan 2003 14:21:25 -0500 (EST) Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.7/8.12.1/Submit) id h0GJLPuk025425; Thu, 16 Jan 2003 14:21:25 -0500 (EST) (envelope-from hiten) Date: Thu, 16 Jan 2003 14:21:25 -0500 From: Hiten Pandya To: Nate Lawson Cc: Hidetoshi Shimokawa , cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/firewire firewire.c fwdev.c fwohci.c fwohcivar.h Message-ID: <20030116192125.GA24866@unixdaemons.com> References: <20030116130939.3C65A37B4CD@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jan 16, 2003 at 10:10:29AM -0800, Nate Lawson wrote the words in effect of: > On Thu, 16 Jan 2003, Hidetoshi Shimokawa wrote: > > Modified files: > > sys/dev/firewire firewire.c fwdev.c fwohci.c fwohcivar.h > > Log: > > Improve memory allocation. > > - Don't use contigmalloc() and allocate page by page to avoid > > allocation failure. > > - allocate buffer by PAGE_SIZE. > > Some comments. > > > - contigfree((void *)(uintptr_t)sc->fc.sid_buf, > > - OHCI_SIDSIZE, M_DEVBUF); > > + free((void *)(uintptr_t)sc->fc.sid_buf, M_DEVBUF); > > Unnecessary casts (there are others). > > > malloc(sizeof(struct fwohcidb_tr) * dbch->ndb, > > M_DEVBUF, M_DONTWAIT | M_ZERO); > > The correct flag is M_NOWAIT. You should do a global sed on this in your > code. Hmm, I think it's about time we add this NOTE to the malloc(9) manual page. -- Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org) http://www.unixdaemons.com/~hiten/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message