grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unnecessary parameter in grub_term_register_{input,output} ()


From: Bean
Subject: Re: unnecessary parameter in grub_term_register_{input,output} ()
Date: Sun, 20 Sep 2009 12:42:11 +0800

On Sun, Sep 20, 2009 at 5:39 AM, Robert Millan <address@hidden> 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:
>
>  static inline void
>  grub_term_register_input (const char *name __attribute__ ((unused)),
>                          grub_term_input_t term)
>  {
>   grub_handler_register (&grub_term_input_class, GRUB_AS_HANDLER (term));
>  }
>
>  static inline void
>  grub_term_register_output (const char *name __attribute__ ((unused)),
>                           grub_term_output_t term)
>  {
>   grub_handler_register (&grub_term_output_class, GRUB_AS_HANDLER (term));
>  }
>
> Such as:
>
>  void
>  grub_console_init (void)
>  {
>    grub_term_register_output ("console", &grub_console_term_output);
>    grub_term_register_input ("console", &grub_console_term_input);
>  }
>
> 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.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]