Find the answer to your Linux question:
Results 1 to 3 of 3
Hello Friends I'm using RH9 2.4 kernel and i've problem with module_param() function in the module. i've declared one global variable say static int x =1; /*and the rest of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    1

    proble with MODULE_PARM()


    Hello Friends

    I'm using RH9 2.4 kernel and i've problem with module_param() function in the module.

    i've declared one global variable say

    static int x =1;

    /*and the rest of the functions in the module*/

    ..........
    .........

    MODULE_PARM(x,"i");
    .......
    ........
    /*finish the code*/

    but it is showing error in compiling like

    "parse error before string constant "
    warning : type defaults to 'int' in the declaration of module param
    warning : data definition has no type or storage class

    i've also tried

    module_param(x, int);
    but getting the same, "parse error before "int" "

    please somebody get me out of this

    Thanks in Advance,

    Pratik H Pandya.

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    You are missing a vital argument to module_param(), which is the permissions mask for the sysfs entry:
    Code:
    static int x = 1;
    module_param(x, int, S_IRUGO);
    for example.

  3. #3
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Quote Originally Posted by lakerdonald
    You are missing a vital argument to module_param(), which is the permissions mask for the sysfs entry:
    Code:
    static int x = 1;
    module_param(x, int, S_IRUGO);
    for example.
    Does a 2.4 kernel have sysfs???
    I doubt...
    AFAIK, sysfs is introduced in 2.6

    Also, AFAIK, RH9 uses version 2.4.18...
    The source of 2.4.18 doesn't define module_param() at all...
    Take a look at:
    http://lxr.linux.no/ident?v=2.4.18&i=module_param
    The Unforgiven
    Registered Linux User #358564

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •