lkml.org 
[lkml]   [2010]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lis3: Add axes module parameter for custom axis-mapping
Op 07-09-10 16:44, Takashi Iwai schreef:
:
>> Wouldn't it be much cleaner if lis3_dev.ac was an array instead of a
>> struct? I don't mind that it involves changing more line if it makes
>> things more understandable.
>
> OK, then it makes things easier. The revised patch is below.
Yes, I like it much better...

>
> +module_param_array_named(axes, lis3_dev.axis_map, int, NULL, 0644);
> +MODULE_PARM_DESC(axes, "Axis-mapping for x,y,z directions");
But now there is no check at all about the value being between 1 and 3,
is there?

I think it's still necessary to have a small function which checks for
correct values, otherwise the user could read a bit anywhere in the memory.

Eric


\
 
 \ /
  Last update: 2010-09-07 17:57    [W:0.613 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site