From: Stefan Achatz <erazor_de@users.sourceforge.net>
To: Jiri Kosina <jkosina@suse.cz>
Cc: "Randy Dunlap" <rdunlap@xenotime.net>,
"Bruno Prémont" <bonbons@linux-vserver.org>,
"Stephane Chatty" <chatty@enac.fr>,
"Don Prince" <dhprince-devel@yahoo.co.uk>,
"Dmitry Torokhov" <dtor@mail.ru>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org
Subject: Re: [PATCH] HID: roccat: Add support for Roccat Kone[+]
Date: Fri, 05 Nov 2010 18:42:42 +0100 [thread overview]
Message-ID: <1288978962.2585.15.camel@neuromancer> (raw)
In-Reply-To: <alpine.LNX.2.00.1011041418530.15851@pobox.suse.cz>
Hello,
Am Donnerstag, den 04.11.2010, 14:25 -0400 schrieb Jiri Kosina:
> On Sun, 24 Oct 2010, Stefan Achatz wrote:
>
> > This patch adds support for Roccat Kone[+] gaming mouse. Kone[+] is an enhanced version
> > of the old Kone with more memory for macros, a better sensor and more functionality.
> > This driver is conceptual similar to the existing Kone and Pyra drivers.
> > Userland tools can soon be found at http://sourceforge.net/projects/roccat
>
> Seems like there is a lot of duplicate code with Roccat Kone.
> Is there any reason this couldn't be merged with the Roccat Kone
> counterparts?
In fact the Kone[+] seems to be nearer to the Pyra than the old Kone.
Looks like the manufacturer changed the firmware programmer between some
devices. I wanted to wait until I see more devices of this manufacturer
if some kind of genealogy might be visible and remove code duplication
based on that.
> > +static ssize_t koneplus_sysfs_read_profile5_settings(struct file *fp,
> > + struct kobject *kobj, struct bin_attribute *attr, char *buf,
> > + loff_t off, size_t count)
> > +{
> > + return koneplus_sysfs_read_profilex_settings(fp, kobj,
> > + attr, buf, off, count, 4);
> > +}
> > +
>
> This is really ugly. Can't you have just one read() function and
> distuingish according to bin_attribute->private?
The patch comes in a view moments, if you like it I'll do the same for
Kone and Pyra.
>
> > diff --git a/drivers/hid/hid-roccat-koneplus.h b/drivers/hid/hid-roccat-koneplus.h
> > new file mode 100644
> > index 0000000..bf750fa
> > --- /dev/null
> > +++ b/drivers/hid/hid-roccat-koneplus.h
> > @@ -0,0 +1,229 @@
> > +#ifndef __HID_ROCCAT_KONEPLUS_H
> > +#define __HID_ROCCAT_KONEPLUS_H
> > +
> > +/*
> > + * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
> > + */
> > +
> > +/*
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms of the GNU General Public License as published by the Free
> > + * Software Foundation; either version 2 of the License, or (at your option)
> > + * any later version.
> > + */
> > +
> > +#include <linux/types.h>
> > +
> > +#pragma pack(push)
> > +#pragma pack(1)
>
> Why?
What?
Have a nice day,
Stefan
next prev parent reply other threads:[~2010-11-05 17:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1287943025.2623.16.camel@neuromancer>
2010-11-04 18:25 ` [PATCH] HID: roccat: Add support for Roccat Kone[+] Jiri Kosina
2010-11-05 17:42 ` Stefan Achatz [this message]
2010-11-05 18:01 ` Jiri Kosina
2010-11-06 18:51 ` [PATCH 1/3] HID: roccat: Reducing number of functions in kone and pyra drivers Stefan Achatz
2010-11-06 18:52 ` [PATCH 2/3] HID: roccat: declaring meaning of pack pragma usage in koneplus driver Stefan Achatz
2010-11-06 18:53 ` [PATCH 3/3] HID: roccat: declaring meaning of pack pragma usage in kone and pyra driver Stefan Achatz
2010-11-12 19:16 ` [PATCH] HID: roccat: Add support for Roccat Kone[+] Stefan Achatz
2010-11-05 17:53 ` [PATCH] HID: roccat: Using bin-attribute->private to reduce code duplication Stefan Achatz
2010-11-11 9:00 ` [PATCH] HID: roccat: Add support for Roccat Kone[+] Dmitry Torokhov
2010-10-24 17:57 Stefan Achatz
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=1288978962.2585.15.camel@neuromancer \
--to=erazor_de@users.sourceforge.net \
--cc=bonbons@linux-vserver.org \
--cc=chatty@enac.fr \
--cc=dhprince-devel@yahoo.co.uk \
--cc=dtor@mail.ru \
--cc=jkosina@suse.cz \
--cc=linux-doc@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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;
as well as URLs for NNTP newsgroup(s).