Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MpEFh-0000VA-9l for mharc-grub-devel@gnu.org; Sun, 20 Sep 2009 00:42:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MpEFe-0000SQ-7j for grub-devel@gnu.org; Sun, 20 Sep 2009 00:42:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MpEFZ-0000Nu-Gb for grub-devel@gnu.org; Sun, 20 Sep 2009 00:42:17 -0400 Received: from [199.232.76.173] (port=38735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MpEFZ-0000NX-BH for grub-devel@gnu.org; Sun, 20 Sep 2009 00:42:13 -0400 Received: from mail-px0-f171.google.com ([209.85.216.171]:47597) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MpEFZ-000486-0Y for grub-devel@gnu.org; Sun, 20 Sep 2009 00:42:13 -0400 Received: by pxi1 with SMTP id 1so1671016pxi.1 for ; Sat, 19 Sep 2009 21:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZhRyb/lGLLS4DbgikktqZjIilYlKZwVa7RErobi3qVA=; b=mOiwPWzajLm1D/+ndigbYUK5+XlH+6ex3oT1tSw7RWO/6Mt369gxSpOiprVT8ivaMa zKMU4Nd5oSc5veBRu6lf4PCn5CE30xeLQx65knPQ9nj80nghQAbvkOQzrQD5/g10VWM4 tsgPTqbkLZ8Wg6YNfyrneS1Pa5IUlt/rjSDrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=OBj1UPfExsw4OTTHoWNc4OHlOO45OE0IOrxS9gujJgj0+xLA13uQrY9n+tlNHEXcFj ZaLyw8aHTmhaM3sa2dAquXWvkpDIxlom9EtgUxZibB/TuawMrmYsNQ98KwtXtT9zqD3+ 5zTHE2YduzjBlIS28bvI/9WtfQNnBYeEoS8d0= MIME-Version: 1.0 Received: by 10.141.51.5 with SMTP id d5mr195894rvk.172.1253421731957; Sat, 19 Sep 2009 21:42:11 -0700 (PDT) In-Reply-To: <20090919213948.GA16537@thorin> References: <20090919213948.GA16537@thorin> Date: Sun, 20 Sep 2009 12:42:11 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: unnecessary parameter in grub_term_register_{input,output} () 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: Sun, 20 Sep 2009 04:42:19 -0000 On Sun, Sep 20, 2009 at 5:39 AM, Robert Millan wrote: > > Maybe there's some subtle detail I'm missing, but it seems to me that it'= s > completely pointless to pass the `name' parameter in all calls to these > two functions: > > =A0static inline void > =A0grub_term_register_input (const char *name __attribute__ ((unused)), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0grub_term_input_t term= ) > =A0{ > =A0 grub_handler_register (&grub_term_input_class, GRUB_AS_HANDLER (term)= ); > =A0} > > =A0static inline void > =A0grub_term_register_output (const char *name __attribute__ ((unused)), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 grub_term_output_t te= rm) > =A0{ > =A0 grub_handler_register (&grub_term_output_class, GRUB_AS_HANDLER (term= )); > =A0} > > Such as: > > =A0void > =A0grub_console_init (void) > =A0{ > =A0 =A0grub_term_register_output ("console", &grub_console_term_output); > =A0 =A0grub_term_register_input ("console", &grub_console_term_input); > =A0} > > Since we don't use it, and the same information is in term->name anyway. > > Does anyone see a reason not to simplify this? Hi, This is used to generate handler.lst automatically, and as name is marked as unused, it won't generate extra code. --=20 Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/