lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 19 Feb 2009 18:27:14 +0100
From:	Jean Delvare <khali@...ux-fr.org>
To:	Frank Seidel <fseidel@...e.de>
Cc:	linux kernel <linux-kernel@...r.kernel.org>,
	akpm@...ux-foundation.org, rlove@...ve.org, protasnb@...il.com,
	Michael Ruoss <miruoss@...dent.ethz.ch>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Tim Gardner <tim.gardner@...onical.com>,
	Frank Seidel <frank@...eidel.de>, multinymous@...il.com,
	Frank Seidel <fseidel@...e.de>
Subject: Re: [PATCH] hwmon/hdaps: remove redundant sysfs invert

Hi Frank,

On Thu, 19 Feb 2009 13:44:43 +0100, Frank Seidel wrote:
> From: Frank Seidel <frank@...eidel.de>
> 
> Get rid of sysfs attribute "invert" as its
> redundant to module parameter.

It seems it isn't that easy:

> 
> Signed-off-by: Frank Seidel <frank@...eidel.de>
> ---
>  drivers/hwmon/hdaps.c |   24 ------------------------
>  1 file changed, 24 deletions(-)
> 
> --- a/drivers/hwmon/hdaps.c
> +++ b/drivers/hwmon/hdaps.c
> @@ -428,28 +428,6 @@ static ssize_t hdaps_calibrate_store(str
>  	return count;
>  }
>  
> -static ssize_t hdaps_invert_show(struct device *dev,
> -				 struct device_attribute *attr, char *buf)
> -{
> -	return sprintf(buf, "%u\n", hdaps_invert);
> -}
> -
> -static ssize_t hdaps_invert_store(struct device *dev,
> -				  struct device_attribute *attr,
> -				  const char *buf, size_t count)
> -{
> -	int invert;
> -
> -	if (sscanf(buf, "%d", &invert) != 1 ||
> -	    invert < 0 || invert > HDAPS_BOTH_AXES)
> -		return -EINVAL;
> -
> -	hdaps_invert = invert;
> -	hdaps_calibrate();

Apparently recalibration is necessary when you change the inversion
settings. The module parameter, which you made writable in a previous
patch, does _not_ recalibrate when changed.

So it was probably not such a good idea to make the module parameter
writable, and that should be reverted. Which in turn means that the
sysfs attribute "invert" has to stay.

> -
> -	return count;
> -}
> -
>  static DEVICE_ATTR(position, 0444, hdaps_position_show, NULL);
>  static DEVICE_ATTR(variance, 0444, hdaps_variance_show, NULL);
>  static DEVICE_ATTR(temp1, 0444, hdaps_temp1_show, NULL);
> @@ -457,7 +435,6 @@ static DEVICE_ATTR(temp2, 0444, hdaps_te
>  static DEVICE_ATTR(keyboard_activity, 0444, hdaps_keyboard_activity_show, NULL);
>  static DEVICE_ATTR(mouse_activity, 0444, hdaps_mouse_activity_show, NULL);
>  static DEVICE_ATTR(calibrate, 0644, hdaps_calibrate_show,hdaps_calibrate_store);
> -static DEVICE_ATTR(invert, 0644, hdaps_invert_show, hdaps_invert_store);
>  
>  static struct attribute *hdaps_attributes[] = {
>  	&dev_attr_position.attr,
> @@ -467,7 +444,6 @@ static struct attribute *hdaps_attribute
>  	&dev_attr_keyboard_activity.attr,
>  	&dev_attr_mouse_activity.attr,
>  	&dev_attr_calibrate.attr,
> -	&dev_attr_invert.attr,
>  	NULL,
>  };
>  


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ