Re: [PATCH v6 3/3] Input: Add TouchNetix axiom i2c touchscreen driver
From: Dmitry Torokhov
Date: Tue Jan 30 2024 - 18:25:08 EST
On Tue, Jan 30, 2024 at 05:32:54PM +0000, POPESCU Catalin wrote:
> On 25.01.24 17:58, Kamel Bouhara wrote:
> > + u16 offset = (usage_id * AXIOM_U31_BYTES_PER_USAGE);
> > + u8 id = rx_data[offset + 0];
> > + u8 start_page = rx_data[offset + 1];
> > + u8 num_pages = rx_data[offset + 2];
> > + u32 max_offset = ((rx_data[offset + 3] & AXIOM_PAGE_OFFSET_MASK) + 1) * 2;
> > +
> > + if (!num_pages)
> > + usage_table[id].is_report = true;
> please add an else statement to set is_report to false.
Better written as:
usage_table[id].is_report = num_pages == 0;
or
usage_table[id].is_report = !num_pages;
Thanks.
--
Dmitry