[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bba38969-b245-6b79-3836-099c2ded3c22@gmail.com>
Date: Thu, 12 Mar 2020 18:28:25 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Jiada Wang <jiada_wang@...tor.com>, jikos@...nel.org,
benjamin.tissoires@...hat.com, rydberg@...math.org,
dmitry.torokhov@...il.com, nick@...anahar.org, bsz@...ihalf.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
erosca@...adit-jv.com, Andrew_Gabbasov@...tor.com
Subject: Re: [PATCH v7 22/48] Input: atmel_mxt_ts - improve bootloader state
machine handling
12.02.2020 11:41, Jiada Wang пишет:
> From: Nick Dyer <nick.dyer@...ev.co.uk>
>
> The code is much clearer if we switch on the actual state the bootloader
> is in, rather than the state we want it to be in, and allows the removal
> of a goto retry tangle.
...
> case MXT_WAITING_FRAME_DATA:
> - case MXT_APP_CRC_FAIL:
> - val &= ~MXT_BOOT_STATUS_MASK;
> + if ((f->previous != MXT_WAITING_BOOTLOAD_CMD)
> + && (f->previous != MXT_FRAME_CRC_PASS)
> + && (f->previous != MXT_FRAME_CRC_FAIL))
This will cleaner to write as follows:
if (f->previous != MXT_WAITING_BOOTLOAD_CMD &&
f->previous != MXT_FRAME_CRC_PASS &&
f->previous != MXT_FRAME_CRC_FAIL)
Powered by blists - more mailing lists