Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3838977imm; Mon, 18 Jun 2018 05:04:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLttjBF9QyOqjhw2k23D0BfXSEwdETwb1/O8DLmQ98W4b/NPH5R36s5t3XENHs6OalrcrJj X-Received: by 2002:a62:930c:: with SMTP id b12-v6mr13197791pfe.193.1529323487585; Mon, 18 Jun 2018 05:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323487; cv=none; d=google.com; s=arc-20160816; b=iYSdH0l1zt27KpnxJsnwBGM+aQXQLz2BtNVYH66xjtEzMYOx0532xZRrKkqa5QWpd0 nd5H6DnGeD5hoPJ/qyvX779MOltHAA+a8fbKbPv/rcq99qDIKBsxqlb09Grz0bgdZYsK p+wAIwOe9mbO4Lvh6y7yBI2fyiSm0ipgAxOkU/f03birbS6aWxZ2a5rniBpJxvQ6K6AR i1PoCaE/aAJ+OfkzOSuQBJyQi0WpWPIHhSd2X4qscCxwPeLx3wxizE/k5wenABRShEk0 sbjU0zPuGoNBy9ktyOuJORluL8VTifrA48e54Ks4KJwkMApS26fbJNfm11cgoe7BatES xecQ== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=smJOaz/xzilUOIsKO/N97UdvktjMmeAzLa9d6Lva1h8=; b=sP9FDyzWfGjaE6pooLxet73E5xaBOugxDvRA/X3RgpvW4IxAHWlMSlvHasIYpoTPQK JtWmmXfdV3lXRhFIUKbPH0rBdQHfZkek+Y6WzGckVIk69DP1p0yn4eK9nXDisPiFH0Pf qvO4XS7lzx+2wp9l9tN33XHXAZ4CybMyute5xaz3i8m4LSOlbuLxp8VV6lAzmd6WkPlP y7BrVGR57ea/JjfkYp770d5KElCeMHZM2UUUPIh4BdT1sBCP6+GlBn0Tr0cLeP915pT4 fNUkTXDUXb6S5BzYNAArACvXSlO1IwMJtDNi97JcWVE6lSpqPPG20vOTiVpjSViYIJi4 44fg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v30-v6si14743647pfl.233.2018.06.18.05.04.33; Mon, 18 Jun 2018 05:04:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935032AbeFRMC1 (ORCPT + 99 others); Mon, 18 Jun 2018 08:02:27 -0400 Received: from mga18.intel.com ([134.134.136.126]:30401 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933575AbeFRMCY (ORCPT ); Mon, 18 Jun 2018 08:02:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 05:02:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,239,1526367600"; d="scan'208";a="67873583" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga002.jf.intel.com with ESMTP; 18 Jun 2018 05:02:20 -0700 Message-ID: <8cfbdf809f531f8aa315fe1679c3273858038f41.camel@linux.intel.com> Subject: Re: [PATCH v2 5/5] Input: evdev - Switch to bitmap_zalloc() From: Andy Shevchenko To: Joe Perches , Andy Shevchenko , Yury Norov Cc: 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: Mon, 18 Jun 2018 15:02:20 +0300 In-Reply-To: <0a3d86d7746792a2f848cef386941fc182653515.camel@perches.com> References: <20180615132017.23889-1-andriy.shevchenko@linux.intel.com> <20180615132017.23889-6-andriy.shevchenko@linux.intel.com> <20180615214231.GA371@yury-thinkpad> <0a3d86d7746792a2f848cef386941fc182653515.camel@perches.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" 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 12:16 -0700, Joe Perches wrote: > On Sat, 2018-06-16 at 21:45 +0300, Andy Shevchenko wrote: > > On Sat, Jun 16, 2018 at 12:46 AM Yury Norov > om> 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. Maybe. I didn't check if there are such users except this driver. Anyway, it's out of scope of the series. -- Andy Shevchenko Intel Finland Oy