Re: [PATCH] input: Implement idle timeout for fakehid.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeff,

On Mon, Aug 27, 2012, Jeff Hansen wrote:
> +		fake->timeout = iconn->timeout * 1000;

Why not use the original iconn->timeout value and then use
g_timeout_add_seconds instead of g_timeout_add?

> +	guint		idle_timeout;
> +	uint32_t	timeout;

Why uint32_t instead of just int that iconn->timeout is?

> +static gboolean ps3remote_idle(gpointer data)
> +{
> +	struct fake_input *fake = data;
> +	input_device_request_disconnect(fake->idev);
> +	return FALSE;
> +}

Could you add an empty line before and after
input_device_request_disconnect for slightly better readability.

> +	if (fake->idle_timeout) {

For consistency with the rest of the code base please use > 0 for
checking for valid GSource IDs. I'd also just call it idle_id to avoid
confusion with "timeout" which is not a GSource ID.

> +		g_source_remove(fake->idle_timeout);
> +		fake->idle_timeout = 0;
> +	}
> +	if (fake->timeout)
> +		fake->idle_timeout = g_timeout_add(fake->timeout, ps3remote_idle, fake);

Please add an empty line before this second if statement and also do > 0
here.

> +	if (fake->idle_timeout) {

And > 0 again here.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux