Re: [PATCH] hwmon/hdaps: Fix bug 7154 inversion of separate axis

From: Dmitry Torokhov
Date: Sat Feb 14 2009 - 17:26:24 EST


Hi Frank,

On Fri, Feb 13, 2009 at 01:38:01PM +0100, Frank Seidel wrote:
> From: Frank Seidel <frank@xxxxxxxxxxx>
>
> Fix for kernel.org bug #7154:hdaps inversion of
> each axis. This version is based on the work
> from Michael Ruoss <miruoss@xxxxxxxxxxxxxxx>.
>
>
> - /* if hdaps_invert is set, negate the two values */
> - if (hdaps_invert) {
> + /* hdaps_invert is a bitvector to negate the axes */
> + if (hdaps_invert & 1)
> *x = -*x;
> + if (hdaps_invert & 2)
> *y = -*y;
> - }

You have defined HDAPS_{X|Y}_AXIS, why not use them?

>
> -module_param_named(invert, hdaps_invert, bool, 0);
> -MODULE_PARM_DESC(invert, "invert data along each axis");
> +module_param_named(invert, hdaps_invert, int, 0);
> +MODULE_PARM_DESC(invert, "invert data along each axis. 1 invert x-axis, "
> + "2 invert y-axis, 3 invert both axes.");
>

Why don't you make these 0644? I don't see why they can't be changed
"on fly".

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/