From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Michael Hanselmann <linux-kernel@hansmi.ch>
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-kernel@vger.kernel.org,
linux-input@atrey.karlin.mff.cuni.cz, linuxppc-dev@ozlabs.org,
stelian@popies.net, kernel-stuff@comcast.net
Subject: Re: [PATCH 2.6 1/2] usb/input: Add relayfs support to appletouch driver
Date: Wed, 14 Dec 2005 17:04:26 -0500 [thread overview]
Message-ID: <d120d5000512141404wc86331fo124ebd29b713b07e@mail.gmail.com> (raw)
In-Reply-To: <20051214213923.GB17548@hansmi.ch>
Hi,
On 12/14/05, Michael Hanselmann <linux-kernel@hansmi.ch> wrote:
> *
> + * Nov 2005 - Parag Warudkar
> + * o Added ability to export data via relayfs
> + *
> + * Nov/Dec 2005 - Michael Hanselmann
> + * o Compile relayfs support only if enabled in the kernel
> + * o Enable relayfs only if requested by the user
> + *
We have an SCM, not need to have a changelog in the driver.
>
> +#if defined(CONFIG_RELAYFS_FS) || defined(CONFIG_RELAYFS_FS_MODULE)
> +struct rchan* rch = NULL;
> +struct rchan_callbacks* rcb = NULL;
Initializing with 0/NULL adds to the size of the image for no reason.
>
> +#if defined(CONFIG_RELAYFS_FS) || defined(CONFIG_RELAYFS_FS_MODULE)
> +static int relayfs = 0;
Same here.
> +module_param(relayfs, int, 0444);
> +MODULE_PARM_DESC(relayfs, "Activate relayfs support");
> +#endif
> +
> static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact,
> int *z, int *fingers)
> {
> @@ -194,6 +219,13 @@ static void atp_complete(struct urb* urb
> goto exit;
> }
>
> +#if defined(CONFIG_RELAYFS_FS) || defined(CONFIG_RELAYFS_FS_MODULE)
> + /* "rch" is NULL if relayfs is not enabled */
> + if (rch && dev->data) {
> + relay_write(rch, dev->data, dev->urb->actual_length);
> + }
> +#endif
> +
Haveing ifdefs in the middle of the code is not too nice. can we
please have something like this:
#if defined(CONFIG_RELAYFS_FS) || defined(CONFIG_RELAYFS_FS_MODULE)
static inline void appletouch_relayfs_dump(...)
{
...
}
static int appletouch_relayfs_init(void)
{
...
}
static void appletouch_relayfs_exit()
{
...
}
#else
static inline void appletouch_relayfs_dump(...) { }
static int appletouch_relayfs_init(void) { return 0; }
static void appletouch_relayfs_exit() { }
#endif
Also, would not it be better to initialize relayfs only when device is
opened because there won't be any data otehrwise?
--
Dmitry
next prev parent reply other threads:[~2005-12-14 22:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-13 22:36 Michael Hanselmann
2005-12-13 22:40 ` [PATCH 2.6 2/2] usb/input: Add Geyser 2 " Michael Hanselmann
2005-12-17 1:19 ` Michael Hanselmann
2005-12-14 13:57 ` [PATCH 2.6 1/2] usb/input: Add relayfs " Johannes Berg
2005-12-14 21:39 ` Michael Hanselmann
2005-12-14 22:04 ` Dmitry Torokhov [this message]
2005-12-14 23:31 ` Michael Hanselmann
2005-12-15 3:43 ` Dmitry Torokhov
2005-12-15 8:37 ` Michael Hanselmann
2005-12-15 19:50 ` Olof Johansson
2005-12-15 21:26 ` Michael Hanselmann
2005-12-15 21:38 ` Dmitry Torokhov
2005-12-16 17:29 ` Horst von Brand
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=d120d5000512141404wc86331fo124ebd29b713b07e@mail.gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=dtor_core@ameritech.net \
--cc=johannes@sipsolutions.net \
--cc=kernel-stuff@comcast.net \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@hansmi.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=stelian@popies.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
all inboxes | Powered by JetHome®