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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061013165840.GA9517@dreamland.darkstar.lan>
Date:	Fri, 13 Oct 2006 18:58:40 +0200
From:	Luca Tettamanti <kronos.it@...il.com>
To:	Yan Burman <yan_952@...mail.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Remn Yan <yan_952@...mail.com> ha scritto:

Burman Yan <yan_952@...mail.com> ha scritto:
> I would like to hear your remarks on this version.

A couple of small issues:

> +/* Sysfs stuff */
> +static ssize_t mdps_position_show(struct device *dev,
> +                                  struct device_attribute *attr, char *buf)
> +{
> +	int x, y;
> +	mdps_get_xy(mdps.device->handle, &x, &y);
> +	return sprintf(buf, "(%d, %d)\n", x, y);
> +}

hdaps doesn't have the space between the numbers.

> +static ssize_t mdps_position3d_show(struct device *dev,
> +                                    struct device_attribute *attr, char *buf)
> +{
[...]
> +	return sprintf(buf, "(%d, %d, %d)\n", x, y, z);
> +}

I'd also remove the space here for consistency.
Also sysfs should carry "unformatted" data, I would use:

sprintf(buf, "%d %d %d\n", x, y, z);

Maybe we should take a moment to think about an interface for both hdaps
and this one.

> +static ssize_t mdps_calibrate_store(struct device *dev,
> +                   struct device_attribute *attr, const char *buf, size_t count)
> +{
> +	mdps_calibrate_mouse();
> +	return count;
> +}

No locking here?

> +static ssize_t mdps_rate_show(struct device *dev,
> +                              struct device_attribute *attr, char *buf)
> +{
[...]
> +	return sprintf(buf, "sampling rate:\t%dHz\n", rate);
> +}

Raw value, i.e. sprintf(buf, "%d\n", rate).


Luca
-- 
Colui che sorride quando le cose vanno male ha pensato a qualcuno a cui
dare la colpa.
-
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