mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luca Tettamanti <kronos.it@gmail.com>
To: Yan Burman <yan_952@hotmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Remn Yan <yan_952@hotmail.com> ha scritto:
Date: Fri, 13 Oct 2006 18:58:40 +0200	[thread overview]
Message-ID: <20061013165840.GA9517@dreamland.darkstar.lan> (raw)
In-Reply-To: <BAY20-F24D6EADDDBE9963D7307A4D80A0@phx.gbl>

Burman Yan <yan_952@hotmail.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.

  parent reply	other threads:[~2006-10-13 16:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-13 13:10 [PATCH] HP mobile data protection system driver take 2 Burman Yan
2006-10-13 14:48 ` Pavel Machek
2006-10-13 15:15   ` Burman Yan
2006-10-13 16:58 ` Luca Tettamanti [this message]
2006-10-13 18:32   ` Remn Yan <yan_952@hotmail.com> ha scritto: Burman Yan
2006-10-14  8:26     ` HP disk protection " Pavel Machek
2006-10-14 11:30       ` Burman Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061013165840.GA9517@dreamland.darkstar.lan \
    --to=kronos.it@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yan_952@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®