lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF8JNhJVUitsxQXTZAMSszzXXb_QG2oxVTdcJN40JTycmQNOrA@mail.gmail.com>
Date:	Tue, 14 Aug 2012 14:06:45 -0700
From:	Ping Cheng <pinglinux@...il.com>
To:	Henrik Rydberg <rydberg@...omail.se>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Jiri Kosina <jkosina@...e.cz>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/19] Input: Improve the events-per-packet estimate

On Tue, Aug 14, 2012 at 1:01 PM, Henrik Rydberg <rydberg@...omail.se> wrote:
> Hi Ping,
>
> Long time no see. :-)
>
>> > +       /* Make room for KEY and MSC events */
>> > +       events += 7;
>>
>> It is nice to get rid of the redundant pieces and to incorporate
>> common functions. Thank you.
>>
>> I have a question about the code above though.  Why do we use 7
>> instead of going through the keys like:
>>
>>       for (i = 0; i < KEY_MAX; i++)
>>               if (test_bit(i, dev->keybit))
>>                       events++;
>
> Keyboards register a large amount of different keys, but seldom send
> more than one or two at a time. The value 7 is ad hoc, admittedly, but
> it makes the default buffer 8 bytes, which happens to precisely match
> the default buffer in evdev.

That can be a valid reason until we need to report more keys
simultaneously. Please update the comments so we know why we end up
with 7.

Thank you.

Ping
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ