mirror of
https://github.com/bashrc/LKMPG.git
synced 2018-06-11 03:06:54 +02:00
Merge pull request #2 from SunyDays/master
fix module_param_array example
This commit is contained in:
@@ -1017,9 +1017,9 @@ Arrays are supported too, but things are a bit different now than they were in t
|
||||
<pre class="src src-c"><span class="org-type">int</span> <span class="org-variable-name">myintarray</span>[2];
|
||||
module_param_array(myintarray, <span class="org-type">int</span>, <span class="org-constant">NULL</span>, 0); <span class="org-comment-delimiter">/* </span><span class="org-comment">not interested in count </span><span class="org-comment-delimiter">*/</span>
|
||||
|
||||
<span class="org-type">int</span> <span class="org-variable-name">myshortarray</span>[4];
|
||||
<span class="org-type">short</span> <span class="org-variable-name">myshortarray</span>[4];
|
||||
<span class="org-type">int</span> <span class="org-variable-name">count</span>;
|
||||
module_parm_array(myshortarray, <span class="org-type">short</span>, , 0); <span class="org-comment-delimiter">/* </span><span class="org-comment">put count into "count" variable </span><span class="org-comment-delimiter">*/</span>
|
||||
module_param_array(myshortarray, <span class="org-type">short</span>, &count, 0); <span class="org-comment-delimiter">/* </span><span class="org-comment">put count into "count" variable </span><span class="org-comment-delimiter">*/</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -407,9 +407,9 @@ Arrays are supported too, but things are a bit different now than they were in t
|
||||
int myintarray[2];
|
||||
module_param_array(myintarray, int, NULL, 0); /* not interested in count */
|
||||
|
||||
int myshortarray[4];
|
||||
short myshortarray[4];
|
||||
int count;
|
||||
module_parm_array(myshortarray, short, , 0); /* put count into "count" variable */
|
||||
module_param_array(myshortarray, short, &count, 0); /* put count into "count" variable */
|
||||
#+END_SRC
|
||||
|
||||
A good use for this is to have the module variable's default values set, like an port or IO address. If the variables contain the default values, then perform autodetection (explained elsewhere). Otherwise, keep the current value. This will be made clear later on.
|
||||
|
||||
@@ -1191,9 +1191,9 @@ module_param_array(myintarray, int, NULL, 0); <i>* not interested in count *</i>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
int myshortarray[4];
|
||||
short myshortarray[4];
|
||||
int count;
|
||||
module_parm_array(myshortarray, short, , 0); <i>* put count into "count" variable *</i>
|
||||
module_param_array(myshortarray, short, &count, 0); <i>* put count into "count" variable *</i>
|
||||
#+END_SRC
|
||||
</p>
|
||||
|
||||
|
||||
@@ -451,9 +451,9 @@ Arrays are supported too, but things are a bit different now than they were in t
|
||||
int myintarray[2];
|
||||
module_param_array(myintarray, int, NULL, 0); /* not interested in count */
|
||||
|
||||
int myshortarray[4];
|
||||
short myshortarray[4];
|
||||
int count;
|
||||
module_parm_array(myshortarray, short, , 0); /* put count into "count" variable */
|
||||
module_param_array(myshortarray, short, &count, 0); /* put count into "count" variable */
|
||||
#+END_SRC
|
||||
|
||||
A good use for this is to have the module variable's default values set, like an port or IO address. If the variables contain the default values, then perform autodetection (explained elsewhere). Otherwise, keep the current value. This will be made clear later on.
|
||||
|
||||
@@ -920,9 +920,9 @@ Arrays are supported too, but things are a bit different now than they were in t
|
||||
<pre class="src src-c"><span class="org-type">int</span> <span class="org-variable-name">myintarray</span>[2];
|
||||
module_param_array(myintarray, <span class="org-type">int</span>, <span class="org-constant">NULL</span>, 0); <span class="org-comment-delimiter">/* </span><span class="org-comment">not interested in count </span><span class="org-comment-delimiter">*/</span>
|
||||
|
||||
<span class="org-type">int</span> <span class="org-variable-name">myshortarray</span>[4];
|
||||
<span class="org-type">short</span> <span class="org-variable-name">myshortarray</span>[4];
|
||||
<span class="org-type">int</span> <span class="org-variable-name">count</span>;
|
||||
module_parm_array(myshortarray, <span class="org-type">short</span>, , 0); <span class="org-comment-delimiter">/* </span><span class="org-comment">put count into "count" variable </span><span class="org-comment-delimiter">*/</span>
|
||||
module_param_array(myshortarray, <span class="org-type">short</span>, &count, 0); <span class="org-comment-delimiter">/* </span><span class="org-comment">put count into "count" variable </span><span class="org-comment-delimiter">*/</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -369,9 +369,9 @@ Arrays are supported too, but things are a bit different now than they were in t
|
||||
int myintarray[2];
|
||||
module_param_array(myintarray, int, NULL, 0); /* not interested in count */
|
||||
|
||||
int myshortarray[4];
|
||||
short myshortarray[4];
|
||||
int count;
|
||||
module_parm_array(myshortarray, short, , 0); /* put count into "count" variable */
|
||||
module_parm_array(myshortarray, short, &count, 0); /* put count into "count" variable */
|
||||
#+END_SRC
|
||||
|
||||
A good use for this is to have the module variable's default values set, like an port or IO address. If the variables contain the default values, then perform autodetection (explained elsewhere). Otherwise, keep the current value. This will be made clear later on.
|
||||
|
||||
Reference in New Issue
Block a user