[hipl-dev] Re: [Branch ~toxedvirus/hipl/hipfw-modules] Rev 5008: Forward command line initialization to modules in order to allow registering command line options...

  • From: Andrius Bentkus <Andrius.Bentkus@xxxxxxxxxxxxxx>
  • To: hipl-dev@xxxxxxxxxxxxx
  • Date: Thu, 4 Nov 2010 11:51:02 +0100

On Thu, Nov 4, 2010 at 11:36 AM, Stefan Götz <stefan.goetz@xxxxxxxxxxxxxxxxx
> wrote:

> > +void hip_cmd_init(struct hip_cmd_option_list *option_list,
> > +                  const struct module_info *const modules,
> > +                  const unsigned int size)
> > +{
> > +    unsigned int i;
> > +    for (i = 0; i < size; i++) {
> > +        if ((modules[i].cmd_function != NULL) &&
> !lmod_module_disabled(modules[i].name)) {
> > +            modules[i].cmd_function(option_list);
> > +        }
> > +    }
> > +}
>
> Diego seems to not like the '!= NULL' in checks so much...
>

How else am I supposed to check a function pointer?


>
> Why does this function not check the option_list and modules parameters for
> NULL
> pointers?
>

Shall I check every paramter for a possible NULL value and print an error
message?


>

Stefan
>
>

Other related posts: