All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann Cantin <yann.cantin-QFKgK+z4sOrR7s880joybQ@public.gmane.org>
To: Jiri Kosina <jkosina-AlSwsSmVLrQ@public.gmane.org>
Cc: linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-1ReQVI26iDCaZKY3DrU6dA@public.gmane.org>

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
--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
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
--

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

Thread overview: 12+ 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
     [not found] ` <1343912397-18353-1-git-send-email-yann.cantin-QFKgK+z4sOrR7s880joybQ@public.gmane.org>
2012-08-02 12:59   ` [RFC ebeam PATCH v2 2/3] hid: hid-core.c: Blackist " Yann Cantin
2012-08-02 12:59     ` 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
     [not found]     ` <alpine.LRH.2.00.1208031424250.15211-1ReQVI26iDCaZKY3DrU6dA@public.gmane.org>
2012-08-03 15:30       ` Yann Cantin [this message]
2012-08-03 15:30         ` Yann Cantin
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
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-qfkgk+z4sorr7s880joybq@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.