Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp646501pxk; Wed, 9 Sep 2020 15:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH9P8XXcrtfyo3G0zxNw4lzpVmzQRsfMeOZmcaDjoEst7vJSuHI3FEt37GzGVvUyGdXq1x X-Received: by 2002:a17:906:375a:: with SMTP id e26mr5669602ejc.552.1599689652379; Wed, 09 Sep 2020 15:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599689652; cv=none; d=google.com; s=arc-20160816; b=KFB30+ncOMMJ/sAg/uxWgzdvIAudiZxiDpz7KXvPtFiQvDG/dGPQS9HSJKj88jtPj+ UAzxK+dYHu61aoF4mQZbuvux6BaCF+AnGP1dB3TDRnnTf0AmCNQ8UVWegoo8J4ljHO+V ggMnANekt0vRh2OWHxXBafmAjsAx7EyOBDW8ofSYY8Ul2WEYjx7YtYuXQeyKJ8E+RleG kfIi8AymshfP3Vp7zz+G1ibtXbWV/8alTPnPP9EE/4DDnNOSFbGWbhj7NJQ+sY6h9tsI tsC4B7jUc48jyPHhV9kF4AZP9Z9li1CGkCd4BUwdIpuDrCKsJJt5HdN+rDIQpr+i055K pPzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=RAGnsBQeLY1V8ML1OsGQYofAT0P+6wUzkImB0xTySrQ=; b=ACliqaZgYjZ8nbr0VUPNoMXL8mHBZ7Vm6gI6O1I7MfYCYe4D221Np6fc3tOgcQT3TZ n+c5hCBycQArPzV6N48GRQgr2nucs5OL/r22Ym82JpLRaLfdQXaNgiTTVtWiMs+AnXvu XzuFcmyxafm9QVfmGXqVZBBnuZfCeKONJa8Vh9DftYyCnqGFvyU8AU/BV1grQ8TRjUT3 GeMcJWvoT5YPASr0J9h5ng1G73t1jqU3sc9wRGhzBc5/th9xFsl2UjPmVIiL/1XFBYX4 Oeid9UtmH7U2jDX1FzWsazwdHrzGIJkKF7PsAU+0yxNyGkbwfIQmhsH+P4Bkim46a9hX cq9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si2501776edb.467.2020.09.09.15.13.49; Wed, 09 Sep 2020 15:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbgIIWLt (ORCPT + 99 others); Wed, 9 Sep 2020 18:11:49 -0400 Received: from smtprelay0119.hostedemail.com ([216.40.44.119]:47168 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726426AbgIIWLt (ORCPT ); Wed, 9 Sep 2020 18:11:49 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 7970318225E0D; Wed, 9 Sep 2020 22:11:48 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2898:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3873:4250:4321:5007:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12297:12438:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21627:21990:30012:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: cork39_10056d8270e0 X-Filterd-Recvd-Size: 2050 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Wed, 9 Sep 2020 22:11:47 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3] HID: add vivaldi HID driver From: Joe Perches To: Sean O'Brien , Benjamin Tissoires , Jiri Kosina Cc: linux-input@vger.kernel.org, LKML Date: Wed, 09 Sep 2020 15:11:46 -0700 In-Reply-To: <20200909150254.1.I170489c0c2ac1538b3890abb5a92b95ad4f04d01@changeid> References: <20200909150254.1.I170489c0c2ac1538b3890abb5a92b95ad4f04d01@changeid> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-09-09 at 15:03 -0700, Sean O'Brien wrote: > Add vivaldi HID driver. This driver allows us to read and report the top > row layout of keyboards which provide a vendor-defined (Google) HID > usage. [] > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c [] > @@ -814,6 +814,13 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type) > > if ((parser->global.usage_page << 16) >= HID_UP_MSVENDOR) > parser->scan_flags |= HID_SCAN_FLAG_VENDOR_SPECIFIC; > + > + if ((parser->global.usage_page << 16) == HID_UP_GOOGLEVENDOR) > + for (i = 0; i < parser->local.usage_index; i++) > + if (parser->local.usage[i] == > + (HID_UP_GOOGLEVENDOR | 0x0001)) > + parser->device->group = > + HID_GROUP_VIVALDI; Can you please make this less indented code so there are fewer line breaks? Something like: if ((parser->global.usage_page << 16) != HID_UP_GOOGLEVENDOR) return; for (i = 0; i < parser->local.usage_index; i++) { if (parser->local.usage[i] != (HID_UP_GOOGLEVENDOR | 0x0001)) continue; parser->device->group = HID_GROUP_VIVALDI; break; }