Re: module parameters

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

 



On Thu, Jun 10, 2004 at 20:11:31 +0530, aksingh@hss.hns.com wrote:
> 
> 
> 
> 
> Hi,
> 
>   How are module parameters used in modules, i.e if I do an "insmod
> my_module.o debug_level=4", then would the variable debug_level be

The variable will always be available, because you will declare it. If
you pass debug_level=4, then it will have value 4 in spite of static
initialization saying something else...

> available to me inside the module ?, can i do this inside the module if
> (debug_level>2) printk(); ??

You can. But of course, #ifdefs are faster, runtimewise (which usualy
does not matter for applications, but interrupt handlers might care).

> i have to access this debug level with argc, argv etc, or this would be
> directly available as the same name ??

There is nothing like argv.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux