From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MVuGB-0007lJ-Eg for mharc-grub-devel@gnu.org; Tue, 28 Jul 2009 17:30:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVuGA-0007lE-BZ for grub-devel@gnu.org; Tue, 28 Jul 2009 17:30:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVuG6-0007kn-0l for grub-devel@gnu.org; Tue, 28 Jul 2009 17:30:57 -0400 Received: from [199.232.76.173] (port=49490 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVuG5-0007kj-Pr for grub-devel@gnu.org; Tue, 28 Jul 2009 17:30:53 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:49470 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVuG4-0002Wg-Sv for grub-devel@gnu.org; Tue, 28 Jul 2009 17:30:53 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MVtn6-0001DX-Ur for grub-devel@gnu.org; Tue, 28 Jul 2009 21:00:57 +0000 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MVqgx-00006z-Ld for grub-devel@gnu.org; Tue, 28 Jul 2009 19:42:23 +0200 Date: Tue, 28 Jul 2009 19:42:23 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090728174223.GC32726@thorin> References: <1340f8530907191211o53119415nf7510cc1e7a89ee1@mail.gmail.com> <1340f8530907271358g2634fe16w15d4297b1b8f30df@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Greylist: delayed 1773 seconds by postgrey-1.27 at monty-python; Tue, 28 Jul 2009 17:30:52 EDT Subject: Re: [PATCH] Bug fix for LVM X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 21:30:58 -0000 On Tue, Jul 28, 2009 at 11:15:09PM +0800, Bean wrote: > - buf2 = grub_zalloc (size); > + buf2 = grub_malloc (size); > if (!buf2) > return grub_errno; > > + grub_memset (buf, 0, size); We just received 'buf' as parameter. Why do we have to zero it here? > +static int > +probe_raid_level (grub_disk_t disk) > +{ > + if (disk->dev->id != GRUB_DISK_DEVICE_RAID_ID) > + return -1; > + > + return ((struct grub_raid_array *) disk->data)->level; > +} Since this an ad-hoc function, could you put it in the same block that needs it? If 'static' qualifier is present, it won't result in nested function AFAICT. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."