Re: [PATCH] Input: wm831x-ts - Remove use of ternery operator

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

 



On Mon, Jan 31, 2011 at 12:01:55PM +0000, Mark Brown wrote:
> While being applied the driver was modified to add use of the ternery
> operator. Write the conditionals out longhand as I find it terribly
> unhelpful for legibility.
> 
> Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> ---
> 
> This is a bit of a preference issue but as I'm most likely to be
> updating the code it would be very helpful if you could apply it.
> 
>  drivers/input/touchscreen/wm831x-ts.c |   18 +++++++++++++-----
>  1 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
> index a6121bd..1022f71 100644
> --- a/drivers/input/touchscreen/wm831x-ts.c
> +++ b/drivers/input/touchscreen/wm831x-ts.c
> @@ -76,9 +76,14 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data)
>  	struct wm831x *wm831x = wm831x_ts->wm831x;
>  	static int data_types[] = { ABS_X, ABS_Y, ABS_PRESSURE };
>  	u16 data[3];
> -	int count = wm831x_ts->pressure ? 3 : 2;
> +	int count;
>  	int i, ret;
>  
> +	if (wm831x_ts->pressure)
> +		count = 3;
> +	else
> +		count = 2;
> +

Hm, OK, although I really wish we did not use 4 lines for something as
simple as this.

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


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux