2006-08-20 16:05:40

by Julio Auto

[permalink] [raw]
Subject: On the definition of the module_param_string macro

In kernel 2.6.17.9, the definition of the module_param_string macro
receives 4 parameters (see linux/include/linux/moduleparam.h:87):

#define module_param_string(name, string, len, perm) ...

allowing the name of the parameter (fed to the macro as 'name'), as it
will be in the .modinfo section, to be different from the actual name
of the variable (fed to the macro as 'string').
To me, it looks inconsistent. If, on the other hand, it was supposed
to be a 'feature', the it looks plain useless (otherwise, the same
rule should apply to other module_param* macros).
So, I would suggest that the definition changes to:

#define module_param_string(name, len, perm) ...

where it would behave like a current use of 'module_param_string(name,
name, len, perm);'

I understand that such changes in the API of modules may cause some
trouble, but it doesn't cost a thing to look at this one as a possible
improvement for the future.

Cheers,

Julio Auto