LWN: Comments on "Driver porting: more module changes" https://lwn.net/Articles/22197/ This is a special feed containing comments posted to the individual LWN article titled "Driver porting: more module changes". en-us Sun, 21 Sep 2025 09:25:51 +0000 Sun, 21 Sep 2025 09:25:51 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Driver porting: more module changes https://lwn.net/Articles/94630/ https://lwn.net/Articles/94630/ linuxosa <p>why the standand kernel source linux/moduleparam.h doesn't have:</p> <I>extern int param_set_byte(const char *val, struct kernel_param *kp); extern int param_get_byte(char *buffer, struct kernel_param *kp);</I> <p>but the comments says:</p> <p><b>/* Helper functions: type is byte, short, ushort, int, uint, long, ulong, charp, bool or invbool, or XXX if you define param_get_XXX, param_set_XXX and param_check_XXX. */</b> </p> Thu, 22 Jul 2004 07:53:40 +0000 Driver porting to 2.5.59: 'MOD_IN_USE' undeclared https://lwn.net/Articles/23885/ https://lwn.net/Articles/23885/ hsieng Hello,<p>While compiling a device driver in 2.5.59, I get the following error:<p>dmodule.c: 'MOD_IN_USE' undeclared<p>Please help on how to solve this problem.<p>Thank you.<p>Se-Hsieng<p><br> Thu, 27 Feb 2003 08:12:43 +0000 Driver porting: more module changes https://lwn.net/Articles/23390/ https://lwn.net/Articles/23390/ rrw I think that there is one problem with this scheme of parameters. In case of numbers you cannot distinguish if the user didn't set the parameter or if he has set it to zero. Perheaps example will explain it better:<p>module_param(howmany, int, 0);<p>if you load this module with howmany=0, howmany will be zero. But if you omit howmany on modload commandline, howmany will be also zero.<p>One should pass the numeric arguments to the code as (int *), not the (int). Then NULL will be ``not set''. Fri, 21 Feb 2003 10:17:43 +0000 Driver porting: more module changes https://lwn.net/Articles/23383/ https://lwn.net/Articles/23383/ mmarq Well, I wonder why bother, ...perahps going for one of the kernel maintainers listed emails,...but then, if anyone can answer to this question i'l be very much appreciataded...it's very important to me!!!<p> Does this &gt;&quot;new &quot;version magic&quot; scheme also records other information, including the compiler version, SMP status, and preempt status; it is thus able to catch more incompatible situations than the old scheme did&quot;&lt;, storm, is to be lefted in production 2.6 kernels, or is it going to be somehow abstracted??<p> Better put!, does a &quot;stupid trying to be a hacker&quot; programmer like me, if by any change achieves the feat of getting a working kernel hardware driver module for the most trivial piece of hardware in the world, say, compiled with kernel 2.6.6 and gcc 3.4, &quot;be in a versioning storm&quot; and have to fix the module for it to recompile with preempt enable, and fix the module againg for it to recompile with SMP enabled, and for Kernel 2.6.7 the same, and for gcc3.4.1 the same,..., meaning that 20 kernel versions and 3 compiler versions ahead i would have to make 180 fixes!?????<p> whaw!!...without meaning any disrespect, it sure is a job for a full time payed hacker!<p> Well!!...If the answer is yes than is very sad &quot;for me and for thousands like me,...because i have a very small shop that transforms old gear and also produce new linux servers and firewall appliences, and dont have the many to hire an army of programmers.<p> Its double sad, because after 10 years of dreams and foughts, the kernel is sleeping to the hands of IBM, HP and the like, that not only have the resources for thousands of programmers, but also control the machines on witch full working kernels can be deployed.<p> Any way, i respectfuly be waiting for a answer.... thank you. Fri, 21 Feb 2003 06:35:25 +0000 Driver porting: more module changes https://lwn.net/Articles/22768/ https://lwn.net/Articles/22768/ rusty Regarding module_param(): MODULE_PARM() will certainly stay throughout the 2.6 series, so no need to change existing code just yet. <p> However, the real power of module_param() is that you can easily build your own types: i.e. it is extensible. One way to do this is to use the underlying module_param_call() macro, but a more convenient way goes like this: <pre> #define param_check_mytype(name, p) /* optional typechecking */ int param_set_mytype(const char *val, struct kernel_param *kp) ... int param_get_mytype(char *buffer, struct kernel_param *kp) ... </pre> Then you can use it as follows: <pre> module_param(myparam, mytype, 000); </pre> This is extremely useful for implementing things like ranges, or any holes in the provided macros. <p> The other issue to note is that (as an unrelated bonus) the module_param parameters are also available as boot parameters, prefixed with the module name and a "." (- and _ can be used interchangably here). Previously __setup() was needed for boot parameters, and MODULE_PARM for module parameters. <p> Hope that helps!<br> Rusty. Fri, 14 Feb 2003 08:41:21 +0000