Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2201105imm; Sat, 16 Jun 2018 11:51:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLK2nArOQ6gGGok/9fOyhDV2KYdiAChuKrFSvUTS3kT/p83132+iENuB/ZubY+dap1BvKn+ X-Received: by 2002:a17:902:854a:: with SMTP id d10-v6mr7451234plo.106.1529175072597; Sat, 16 Jun 2018 11:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529175072; cv=none; d=google.com; s=arc-20160816; b=0hSM/cqS1Wjs7+ec80eKEAdEOub4T5WDMQqFdOym6h5k+3JcS9ZbueLP2sshnYV4JE DXLMvFBFy7bb/qSL/mcATPRvb0QjzLRC9wenmbHDSzhOgjyneQHeXD8JPPGn2U4qqKWF a/Kr3WUJGXhoBHdR6qrVc98KDMdbvjpx2cPX6coEEJ2gC+87jCXqFDpCkWGfD2QPGBEM 8R5U00LOZAgU7GBtbfKt+NdM9PXIwy56/Tsb10tWHISGCb5oAx/h8FplyTyvCYmJnlBu a/YnQI0PU7ctZTvA+qpbbI48F6b2l81/W8XvDHLZSCT4iaxcSv54RG0obapaCLQKZkRU 1l8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=tFdMHNPs8ziCdFtG5v7nJ85VkXeoczbgS7JwBJXSK0E=; b=LjjJJAYsPtSk+deXlW9V3Pgm/3LrbVcqjiZD/f+f0prjzk5ULqHVdnoJr8BtFdgB8l 6OySk3Hs7u2xI7MbiktLkHyLiLvjyJOmPjTRGJsPneXBZNwEW8V/8Cv6S0rweYYP/Yvf dFzjt8f0f+LSP4OUAUdzvMoiVmPI+Or+yCWLHM4BZUNBQnc6GfN91qIHoh9BYo0bV4F2 nEc0jabvCnTxx92dMiMf5I60anUkesw2Pbt8z0VjpwxzU7AU0tryOOUjnkZmWd97iUKw CCuYN42yzydAZUglQsQ4RlDjHoRVDxtb1K6OP7G5rm22NkQR4BxINbJixmeEjPvHpYZF e9RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EFWgFxfY; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si8711454pgo.81.2018.06.16.11.50.57; Sat, 16 Jun 2018 11:51: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EFWgFxfY; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932923AbeFPSud (ORCPT + 99 others); Sat, 16 Jun 2018 14:50:33 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:36034 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932482AbeFPSub (ORCPT ); Sat, 16 Jun 2018 14:50:31 -0400 Received: by mail-ua0-f195.google.com with SMTP id c23-v6so8434223uan.3; Sat, 16 Jun 2018 11:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tFdMHNPs8ziCdFtG5v7nJ85VkXeoczbgS7JwBJXSK0E=; b=EFWgFxfYuqrBoX9J5y88ykkHK9m2Za3JCJbfmLemA3p/mAJyqm13JjtmOpl/7BvFMZ 58snthhplOoSIrAEi9Ic5QxruCjesRf6L0xolKFWo7CPb+2ivIan3QsRRoScwv7pAYC2 qzbrLik31taVDu0XSpnVRgthbLFCEEYxe4WcLODf6ZuNxd6Ew3CNaM4qxQaDuNVpuR5O 2Tkol4C3u5wDXQxeQOH24uxmqHOz70q0aTDOvENDp9Ze2PeFZJlf6R4JzF95v1oiI5eY sjiv1ICk0U2tdbUlwC12K3F9+RwYa4xaYCbY05kFptMk6vyi9ztJNhj1RfZui0CnK0RM kYPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tFdMHNPs8ziCdFtG5v7nJ85VkXeoczbgS7JwBJXSK0E=; b=a2Y1P/m31xVgmkbxsr7MMSf7eblFtuadsTeWmHU0ILMi+WJHWZu2Dql2NOmMLFLZGa FD+COLaqCO32+3D5CnyiEJywoj7EDgUKzxeKsUdd/wAH380mIaN4I0ZbkWyirFWPUv7t +kd749igWkRkJyCOaW1vXQJQRfMaOWHdJSrtsFq/VvTKS7sm6nWJX7qO56cXEpI7uVrn 5W0HagPnVDsZMLVz5j0XrcUi617pqqcG/0LfZ9IRyBplqXfb/xwMcNBPQJKIKGelFHWT iV2IdFVgr3amYlOduiAnysZcnjw68VHNAlTw+I8RiooSqMk8GNZB5PnJAl3+EWZDKDQg WMEw== X-Gm-Message-State: APt69E2YB/PMuUgTROogfeAD10B+ebR368SfbGfrcPVmZwLItHP5GKpD GvCZgXkd7TFo12Lh2pbIO8tNTGeYzDH6VS+ME3M= X-Received: by 2002:a9f:3613:: with SMTP id r19-v6mr4435543uad.49.1529175030811; Sat, 16 Jun 2018 11:50:30 -0700 (PDT) MIME-Version: 1.0 References: <20180615132017.23889-1-andriy.shevchenko@linux.intel.com> <20180615132017.23889-5-andriy.shevchenko@linux.intel.com> <20180615220610.GB371@yury-thinkpad> In-Reply-To: <20180615220610.GB371@yury-thinkpad> From: Andy Shevchenko Date: Sat, 16 Jun 2018 21:50:19 +0300 Message-ID: Subject: Re: [PATCH v2 4/5] Input: gpio-keys - Switch to bitmap_zalloc() To: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 16, 2018 at 1:08 AM Yury Norov wrote: > > On Fri, Jun 15, 2018 at 04:20:16PM +0300, Andy Shevchenko wrote: > > External Email > > > > Switch to bitmap_zalloc() to show clearly what we are allocating. > > Besides that it returns pointer of bitmap type instead of opaque void *. > > Nit. There's no special type for bitmaps, bitmap_zalloc() returns long *. > Is it less opaque than void *, not sure. Yes, it enables type checking by compiler, which is good thing. You can't supply other pointer to this API, like unsigned char *bar = kmalloc(BITS_PER_LONGS(nbits) * sizeof(unsigned long), GFP_KERNEL); ... bitmap_free(bar); //<< compiler will not pass this silently! Or other way around: unsigned char *foo = bitmap_alloc(nbits, GFP_KERNEL); //<< wrong types! -- With Best Regards, Andy Shevchenko