B
bob
I have little C experience and am concurrently trying to tackle C and
LKM's (a little too ambitious maybe) anyway here is the problem I'm
having with an example module I found.
static int myintArray[2] = { -1, -1 };
static int arr_argc = 0;
.
.
.
/*module _param_array(name, type, num, perm);
*the first argument in the arrays name
* the second argument is the arrays data type
* The third argument is a pointer to the variable that will
store the number
* of elements of the array initialized by the user at module
loading time
*the fourth argument is the permission bits
*/
module_param_array(myintArray, int, &arr_argc, 0000);
MODULE_PARM_DESC(myintArray, "an array of integers");
When I compile I get this error : invalid lvalue in unary '&'
initializer element is
not constant
(near initialization for
'__param_arr_myintArray.num')
If I get rid of the address operator it will compile, but this doesn't
seem right - as in how the macro was designed to work. All the errors
point to the same line (49, module_par.....).
Thanks in advance
LKM's (a little too ambitious maybe) anyway here is the problem I'm
having with an example module I found.
static int myintArray[2] = { -1, -1 };
static int arr_argc = 0;
.
.
.
/*module _param_array(name, type, num, perm);
*the first argument in the arrays name
* the second argument is the arrays data type
* The third argument is a pointer to the variable that will
store the number
* of elements of the array initialized by the user at module
loading time
*the fourth argument is the permission bits
*/
module_param_array(myintArray, int, &arr_argc, 0000);
MODULE_PARM_DESC(myintArray, "an array of integers");
When I compile I get this error : invalid lvalue in unary '&'
initializer element is
not constant
(near initialization for
'__param_arr_myintArray.num')
If I get rid of the address operator it will compile, but this doesn't
seem right - as in how the macro was designed to work. All the errors
point to the same line (49, module_par.....).
Thanks in advance