Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2219512imm; Sat, 16 Jun 2018 12:18:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjJeHioqOObqQJSHCoraHz0bRkVXyZRvu5sudlB3zPuIfVP5IUOo+YWtxVxGD4soIzPKlv X-Received: by 2002:aa7:854e:: with SMTP id y14-v6mr7146702pfn.165.1529176692589; Sat, 16 Jun 2018 12:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529176692; cv=none; d=google.com; s=arc-20160816; b=RliacADYA3ijatDcIIe4xlxrhwokvHuHJI6M9QJ4OTh4bGE/nu+2ZojOIQl0Rd6Iqx 2aOVknVz8D8CI+x+p8buOjJhQyswi+roq4jdOrWgQ6/zu1vFCfQ6NYhaSLtp+AEQAsaN wR1vqPDDE+EP4Dp9gW1aqicGitLfGZ4surWSpKmQbm37VZPZwz3D2AhtlZcOUUUAJPPm ey/Jrl8IgqqCevspaw3psuSQLT41rPENbXBvJK8BvqAAsia5kEJffpl0E2j7i54Mihkr TS2QL19900HzohNZieYXp/8UFD0Wsyjt76qyaEqb8Ow09OrNNXAMGkOgQmgq2aq9pIGS oexw== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=oQUMu9+xLI+XMIufmMGjnRE7vXJl/lEGUps0LWB9V+s=; b=Yu/e0CljcHIBjFUTm8qCbJaytpHsAHK2sBKXVZwsO8M8L6YCyVUmy4wtgEXTV6FzEq LbRK3aQ8/ynhuGHJlZt0m4JNJP7tOJ3XvHLUBQOINFjfLXaMsd4rdRSKYD2h4jCZ8+wW Dq2CsWJqOP8fHO43h3qnKfXNPCf5VXU6n8FiGyyMPgHVBOkEKT8wRiw+RHX4NtPWr4n8 YR6ipXP/tsVno3hGoHxXY7i3IWznXX1eR6cs79vsmc8dSfCgmBR70SNgaQxFsshsc3tW P8lnbN87xL2fkY6BebPDyzKBtjcegMpSxxFQOKyCJqSF1Fch0LR349hqwS5AnR7KMnyw fHaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2-v6si10798384pfh.327.2018.06.16.12.17.57; Sat, 16 Jun 2018 12:18:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932921AbeFPTQe (ORCPT + 99 others); Sat, 16 Jun 2018 15:16:34 -0400 Received: from smtprelay0095.hostedemail.com ([216.40.44.95]:60981 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932542AbeFPTQd (ORCPT ); Sat, 16 Jun 2018 15:16:33 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 1C45C837F242; Sat, 16 Jun 2018 19:16:32 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:2895:3138:3139:3140:3141:3142:3353:3622:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:4605:5007:6119:6742:7903:10004:10400:10848:11026:11232:11658:11914:12740:12760:12895:13069:13095:13311:13357:13439:14096:14097:14659:14721:21080:21433:21627:21740:30012:30054:30060:30070:30079:30090:30091,0,RBL:47.151.150.235:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: price38_55da5ed9c1d49 X-Filterd-Recvd-Size: 2581 Received: from XPS-9350.home (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Sat, 16 Jun 2018 19:16:29 +0000 (UTC) Message-ID: <0a3d86d7746792a2f848cef386941fc182653515.camel@perches.com> Subject: Re: [PATCH v2 5/5] Input: evdev - Switch to bitmap_zalloc() From: Joe Perches To: Andy Shevchenko , Yury Norov Cc: Andy Shevchenko , agk@redhat.com, Mike Snitzer , dm-devel@redhat.com, shli@kernel.org, linux-raid@vger.kernel.org, Dmitry Torokhov , linux-input , Andrew Morton , Linux Kernel Mailing List , Mika Westerberg Date: Sat, 16 Jun 2018 12:16:28 -0700 In-Reply-To: References: <20180615132017.23889-1-andriy.shevchenko@linux.intel.com> <20180615132017.23889-6-andriy.shevchenko@linux.intel.com> <20180615214231.GA371@yury-thinkpad> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 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 Sat, 2018-06-16 at 21:45 +0300, Andy Shevchenko wrote: > On Sat, Jun 16, 2018 at 12:46 AM Yury Norov wrote: > > On Fri, Jun 15, 2018 at 04:20:17PM +0300, Andy Shevchenko wrote: > > > Switch to bitmap_zalloc() to show clearly what we are allocating. > > > Besides that it returns pointer of bitmap type instead of opaque void *. > > > > > + mem = bitmap_alloc(maxbit, GFP_KERNEL); > > > if (!mem) > > > return -ENOMEM; > > > > But in commit message you say you switch to bitmap_zalloc(). IIUC > > bitmap_alloc() is OK here. But could you please update comment to > > avoid confusing. > > There are two places, one with alloc, another with zalloc. > I will clarify this in commit message of next version. > > > > + mask = bitmap_zalloc(cnt, GFP_KERNEL); > > > if (!mask) > > > return -ENOMEM; > > > > > > error = bits_from_user(mask, cnt - 1, codes_size, codes, compat); > > > > If my understanding of bits_from_user() correct, here you can also use > > bitmap_alloc(), true? Also it might be useful to have a separate bitmap_from_user to alloc and copy.