Re: [PATCH] Add ff-memless-next module
From: Joe Perches
Date: Thu Dec 26 2013 - 11:58:51 EST
On Thu, 2013-12-26 at 17:33 +0100, Michal Malý wrote:
> This patch adds "ff-memless-next" module. This module is based on the current
> "ff-memless" module but it has considerably extended capabilities. These include:
[]
> Why is this written as a new module and not a patch for "ff-memless"? This
> module uses a different API for the HW-specific driver; this was a necessary
> step to make use of the module's additional features. All 25 drivers that
> currently use "ff-memless" would have to be updated. "ff-memless-next" currently
> does not support FF_RUMBLE which is needed to support various joypads.
Thanks for that explanation.
[]
> +static unsigned long mlnx_get_envelope_update_time(const struct mlnx_effect *mlnxeff,
> + const unsigned long update_rate_jiffies)
> +{
> + /* Effect has an envelope with nonzero fade time */
> + if (mlnxeff->effect.replay.length) {
> + if (!envelope->fade_length)
> + return mlnxeff->stop_at;
> +
> + /* Schedule the next update when the fade begins */
> + if (time_before(mlnxeff->updated_at, mlnxeff->fade_begin))
> + return mlnxeff->fade_begin;
> +
> + /* Already fading */
> + else {
> + fade_next = mlnxeff->updated_at + update_rate_jiffies;
> +
There's no need for an else and extra indentation here
if (foo)
return;
else { /* unnecessary else */
bar...
}
please just use
if (foo)
return;
bar...
> + /* Schedule update when the effect stops */
> + if (time_after(fade_next, mlnxeff->stop_at))
> + return mlnxeff->stop_at;
> + /* Schedule update at the next checkpoint */
> + else
> + return fade_next;
> + }
> + }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/