From patchwork Thu Apr 21 03:18:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hutterer X-Patchwork-Id: 8895821 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C8E00BF29F for ; Thu, 21 Apr 2016 03:18:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFAE520272 for ; Thu, 21 Apr 2016 03:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7141820320 for ; Thu, 21 Apr 2016 03:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751720AbcDUDSe (ORCPT ); Wed, 20 Apr 2016 23:18:34 -0400 Received: from leo.clearchain.com ([199.73.29.74]:32157 "EHLO mail.clearchain.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751707AbcDUDSd (ORCPT ); Wed, 20 Apr 2016 23:18:33 -0400 Received: from leo.clearchain.com (localhost [127.0.0.1]) by mail.clearchain.com (8.15.2/8.15.2) with ESMTPS id u3L3IeRd085648 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 21 Apr 2016 12:48:40 +0930 (CST) (envelope-from peter.hutterer@who-t.net) X-Authentication-Warning: leo.clearchain.com: Host localhost [127.0.0.1] claimed to be leo.clearchain.com Received: (from whot@localhost) by leo.clearchain.com (8.15.2/8.15.2/Submit) id u3L3IeqE085647; Thu, 21 Apr 2016 12:48:40 +0930 (CST) (envelope-from peter.hutterer@who-t.net) X-Authentication-Warning: leo.clearchain.com: whot set sender to peter.hutterer@who-t.net using -f Date: Thu, 21 Apr 2016 13:18:26 +1000 From: Peter Hutterer To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , David Herrmann , Benjamin Tissoires Subject: [PATCH] Input: update documentation for EVIOCGMASK/EVIOCSMASK Message-ID: <20160421031826.GA6719@jelly.local> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.clearchain.com [127.0.0.1]); Thu, 21 Apr 2016 12:48:40 +0930 (CST) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current implementation does not match the most intuitive reading of the documentation. The documentation suggests that anything after FOO_CNT would be reset to zeroes. The implementation however works on long boundaries instead. For example, a client requesting the EV_REL mask will see the first 64 bits set to one in the default mask, everything else is zero. Setting a mask will apply the mask for the first 64 bits, the others are cleared. There are few use-cases where this actually matters to a client - if a device doesn't have the event code anyway the mask doesn't matter. So change two absolute statements to a "may" to indicate that bits may or may not be set. Signed-off-by: Peter Hutterer Reviewed-by: David Herrmann --- include/uapi/linux/input.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index 0111384..6069524 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -181,7 +181,7 @@ struct input_mask { * The default event mask for a client has all bits set, i.e. all events * are forwarded to the client. If the kernel is queried for an unknown * event type or if the receive buffer is larger than the number of - * event codes known to the kernel, the kernel returns all zeroes for those + * event codes known to the kernel, the kernel may return zeroes for those * codes. * * At maximum, codes_size bytes are copied. @@ -204,7 +204,7 @@ struct input_mask { * is unknown to the kernel, or if the number of event codes specified in * the mask is bigger than what is known to the kernel, the ioctl is still * accepted and applied. However, any unknown codes are left untouched and - * stay cleared. That means, the kernel always filters unknown codes + * may be cleared. That means, the kernel always filters unknown codes * regardless of what the client requests. If the new mask doesn't cover * all known event-codes, all remaining codes are automatically cleared and * thus filtered.