lkml.org 
[lkml]   [2020]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 22/48] Input: atmel_mxt_ts - improve bootloader state machine handling
From
Date
12.02.2020 11:41, Jiada Wang пишет:
> From: Nick Dyer <nick.dyer@itdev.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)

\
 
 \ /
  Last update: 2020-03-12 16:29    [W:0.539 / U:1.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site