public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yann Cantin <yann.cantin@laposte.net>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@linuxfoundation.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC ebeam PATCH v2 3/3] input: misc: New USB eBeam input driver.
Date: Fri, 03 Aug 2012 17:30:48 +0200	[thread overview]
Message-ID: <501BEEA8.4060702@laposte.net> (raw)
In-Reply-To: <alpine.LRH.2.00.1208031424250.15211@twin.jikos.cz>

Hi,

>> +#include <linux/hid.h>
> 
> As this driver is not a HID bus driver, why do you need this include?

Cinder, removed

>> +#define DRIVER_VERSION	"v0.7"
> 
> I don't think we need to be tracking driver versions for newly submitted 
> drivers, git is much better at tracking changes.

Old habit, removed.

>> +	u16			 X, Y;		/* raw coordinates	     */
>> +	int			 x, y;		/* computed coordinates      */
> 
> X,x being different fields seems confusing to me. How about, let's say, x, 
> raw_x?

Done.
 
>> +DEVICE_H_ATTR(1);
>> +DEVICE_H_ATTR(2);
>> +DEVICE_H_ATTR(3);
>> +DEVICE_H_ATTR(4);
>> +DEVICE_H_ATTR(5);
>> +DEVICE_H_ATTR(6);
>> +DEVICE_H_ATTR(7);
>> +DEVICE_H_ATTR(8);
>> +DEVICE_H_ATTR(9);
> 
> You are adding a number of sysfs files. If they are really necessary, 
> you'll probably need to document those in Documentation/ABI.

Will do, in testing i suppose.

BTW : The driver need lot of parameters to be passed from user-space calibration
tool. The best way to do it isn't decided yet : one sysfs file per parameter, or
one sysfs file for all, with a big sscanf parsing. Any idea ?

>> +		strlcat(ebeam->name, ")", sizeof(ebeam->name));
> 
> I'd suggest checking the length, making sure that you don't overflow the 
> ->name buffer.

Something like this ? :

if (strlcat(ebeam->name, ")", sizeof(ebeam->name))>=sizeof(ebeam->name)) {
	// overflowed, closing ) anyway
	ebeam->name[sizeof(ebeam->name)-2] = ')';

Thanks.
-- 
Yann Cantin
A4FEB47F
--

  reply	other threads:[~2012-08-03 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 12:59 [RFC ebeam PATCH v2 0/3] new USB eBeam input driver Yann Cantin
2012-08-02 12:59 ` [RFC ebeam PATCH v2 1/3] hid: hid-ids.h: Add vendor and device ID for eBeam classic device Yann Cantin
2012-08-02 12:59 ` [RFC ebeam PATCH v2 2/3] hid: hid-core.c: Blackist " Yann Cantin
2012-08-02 12:59 ` [RFC ebeam PATCH v2 3/3] input: misc: New USB eBeam input driver Yann Cantin
2012-08-03 12:25   ` Jiri Kosina
2012-08-03 15:30     ` Yann Cantin [this message]
2012-08-13  9:06       ` Jiri Kosina
2012-08-02 14:16 ` [RFC ebeam PATCH v2 0/3] new " Jiri Kosina
2012-08-03 12:13   ` Yann Cantin

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=501BEEA8.4060702@laposte.net \
    --to=yann.cantin@laposte.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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