Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1316154imm; Fri, 15 Jun 2018 15:07:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIeo3CSy8DK63plh+CR3/EPn0gO0EDNJ/uyNqkU51q/4yaEnlYXDJoeyMWAhPhRsJ1FQ50p X-Received: by 2002:a17:902:778e:: with SMTP id o14-v6mr3951241pll.214.1529100421750; Fri, 15 Jun 2018 15:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529100421; cv=none; d=google.com; s=arc-20160816; b=qmyMTqR5vTcAE0MSKQar7SY86GTvEFDu/FpRsNsNXwn/lH8vFRZSaoRv6Y63HpwCcK Dg7vmDclC0a8WTaKjR6aBnTF6F9NB6g9njhjtOPakO2z3y1nuVlBJU6YYVDaX/PHE6zl o3FZICaxizYe7eK3QpIkJDvjwwtpyH3h4iprAuAIOfUY5A+2T3ZTV+iYAcDqmje2j2r4 FUkimk5+kYMTk0OxOZR5RQgFBSxb/qlMEnocv04RP6UcxDMcQiAlmvJE3pTsD5Qy20DE O4xff/Cw3nSJolvNNd/dU3eu+0OBdPO+VN+fLSBnlBfYMgTjQL7yFqOQyKJB5J0hYPwh P1gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=OD1gBeiBhsldnOqv5TH19mhL5njzy2jV6c5UDG7l1mM=; b=BTyme57HI2SehSkRN78lTy6Ab7gKE8XmjB5i/1Cw+KrTf4kB3x5KJ4yWznLlNjp6lG xzUPkuMKgKPZflQcUfzEbo0wjHBjY9ohCjm460kom46gbywJP9A5ikEuUhHC3OXQsjCB sEKMRAwdkbunssB5vXh9SyGie6YlHOnsfXdNrfJ/l8NrnroZujnsBnvK68ODquJyuaSS J+k3D4MP1c9nUKCT6ZiMjqtwSf0qaJg3q+PO3wdL+dZJPZgr1lRRTvAf3obqvk85D3Vx B0IipWkbHeRj+Z8bseN6OjcxkGa8RPzdycBBefweTrK1uHroklVSuPmzrXzHoUNrP78e TlkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=ngKRGX5U; 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 18-v6si8715851pfv.135.2018.06.15.15.06.46; Fri, 15 Jun 2018 15:07:01 -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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=ngKRGX5U; 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 S1756703AbeFOWGY (ORCPT + 99 others); Fri, 15 Jun 2018 18:06:24 -0400 Received: from mail-by2nam03on0072.outbound.protection.outlook.com ([104.47.42.72]:37568 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756592AbeFOWGW (ORCPT ); Fri, 15 Jun 2018 18:06:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OD1gBeiBhsldnOqv5TH19mhL5njzy2jV6c5UDG7l1mM=; b=ngKRGX5URswhi6uPHtqDjjpn4opP+s1bWbPs4SB6yWGBPHMAEEDUgWu7hkQT4JZFNMOPq80trX/9tSqyKBQEbncaJCnznZbFD6TAYtHMO968gKOY4S3EEF69yt/4xcCARVy1UE/KoZUrdmRjo9EPfk95tp94VjFe1YwjTcb/TV4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (88.247.2.85) by DM6PR07MB4377.namprd07.prod.outlook.com (2603:10b6:5:bf::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.14; Fri, 15 Jun 2018 22:06:19 +0000 Date: Sat, 16 Jun 2018 01:06:10 +0300 From: Yury Norov To: Andy Shevchenko Cc: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Shaohua Li , linux-raid@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, Andrew Morton , linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com Subject: Re: [PATCH v2 4/5] Input: gpio-keys - Switch to bitmap_zalloc() Message-ID: <20180615220610.GB371@yury-thinkpad> References: <20180615132017.23889-1-andriy.shevchenko@linux.intel.com> <20180615132017.23889-5-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180615132017.23889-5-andriy.shevchenko@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [88.247.2.85] X-ClientProxiedBy: AM0PR01CA0029.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::42) To DM6PR07MB4377.namprd07.prod.outlook.com (2603:10b6:5:bf::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7684741-1b9a-4692-fc3a-08d5d30c392e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020);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V13LRFOXj9nOk8mohlMkSAtqiLQhCZW7ra15SjqkbSLNmDMipQhF44qDmQ3PrngnOxjnJjfeKzudhmPkogKj+plCmN5vU7avZQG5GVsWsbDzyn1hmWJXwGbnjSw1QSsVJDjRAEMAB/tA4KJuX4DOwHQi9GiL3QEmjb1HPfikRtkz/xsBQ0xvV9qK0klo1eQnLB2q7BTGfciz0UNw1G7AnJdzoOC4lpFl+yj2khOEvxVEiZtiPknFRcas/khYnAU7u4d9S5Q6zw/XM6/AQTTcU1X+ppDMRQ9ddJ5KkwcmuU8cKTqjB2X0+7hwjokBWN2pR5tdvIj3AOmkoH1QtsrjM7kh7vyY5tqBE4Rs2LdoXUWiuDpV59sV4MZYbV562CZc/K0L34nUaEGk9bHW8p89X5AOPFsl8lovkdf0F2Rnj5PBoPnLmksvGi8PNhoLJDHBj9+2hDDMB1ZyNxEE8bgpB+Ydzw4l171wTqybKCqF7qHMCy/AXvR0Vli6Etxka3XPnQUjuM8ylU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:DM6PR07MB4377;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4377; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4377;4:IGQ0OK7t26vpmL3w3XJoqN+PI4iMd9lGZd51WSb7e1qFkiXwaM7UieJ3FAN0uGppay3cJgeg6PJ4/oK/o4+CI5yUX7LEOhFIm28h6BVzHYaaS/kMS0Q+DSAx7u9kDge8BVslbxgMoue/1V3UUPU0ytqeeIpO/9ksKH7bdAyDn3mZ4gd/c4F6B7Gl81BTzrhp7eTEhZAe15MFrpyiQegBZ7vKKAo/0AdQrVN/5h2gj5/A8zNEdEd0zM00IrYH8s6PTZlr8tw0QWm+Q712bPXDzCrIH4H9QuwrI/ynTmxBC6NjSweMBVqHzVb5C6H5eAOOLjaFi3HBADNYk07RphMJBg8rdBVHIUekZUURYJUSinI= X-Forefront-PRVS: 0704670F76 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(7916004)(396003)(39380400002)(346002)(376002)(39860400002)(366004)(199004)(189003)(5660300001)(11346002)(446003)(476003)(956004)(2906002)(229853002)(7416002)(68736007)(6916009)(6666003)(7736002)(6496006)(50466002)(305945005)(6486002)(76176011)(486006)(97736004)(33716001)(52116002)(106356001)(55236004)(59450400001)(8936002)(66066001)(42882007)(6116002)(386003)(105586002)(23726003)(1076002)(186003)(26005)(81166006)(33896004)(81156014)(33656002)(76506005)(72206003)(3846002)(47776003)(54906003)(316002)(9686003)(16586007)(53936002)(6246003)(58126008)(16526019)(4326008)(39060400002)(25786009)(8676002)(478600001)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4377;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM6PR07MB4377;23:sO6m9iiqpfZe/5OstHc0IUJEIXpQoIs/8LDHDeaIg?= =?us-ascii?Q?4Lk0bjfR2oLxeYakTirDCoMz5QSj6fs8/DPlroo5Mw87QzVaMtVMGSFbLb6q?= =?us-ascii?Q?/w6z1gooI3R1z2wwMqD/f+d9/NfWSPLi1rKSWDd3xes82krRLVCYz9YuZrjW?= =?us-ascii?Q?SBp+1ZDwDIlf3Sql8/G3klxHWMIuaLlNicaOU97fNT7FQd1aHYO37WIw8gdo?= =?us-ascii?Q?bz3KxL9o2yjLyLUFaWUdHyvBNiC+xHrL1B38FFZAnEt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soWZWlN4Z4zJ9ljkWGowDxdTDMK5g9AbVX?= =?us-ascii?Q?uyEIXLQpJI6qujknzNv47YqLlqF8s78IaQEcEUnePU2GbPQlReLf560a6Q/7?= =?us-ascii?Q?mgmdouoEhxj8mqoTizy6qSA6PKbJY1VO7N7QLVB1saoEj21VV3TU7svJ9j6j?= =?us-ascii?Q?mi8hma6V07WH1uxH4PhUccKmOnCSlZlmpJnO34ybk+VvVn5BHA5vx7cmu531?= =?us-ascii?Q?d2w+Vz9ww3rbcnYxyAW9KmmUnY/q1b7isiyEihxolxvB83e/nhV33pZykOgl?= =?us-ascii?Q?Ypeor1c+l/WRPi87pnPmF/28Kik73mQeUB0exbPjA+iwdDr3HNF?= X-Microsoft-Antispam-Message-Info: moHFr8p39Dv63+HSmI6XVwvAi55gw9pIB3uZ64czB/YiybYPYMMdLndtqSxDID6ZYKHAVKcF+yb7UWCPAgXkJ1LkfpcBddVJXpyuqB3TxIXB4TnAo1Qad+M7xrrX/YyKNnkDv3jOKucQmhgr7OFCIuugdPF20JhxGTPID8CBb7FwizpGZ7w3wtqIccfTSshp X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4377;6:a1W2JEbucH9G9gfCud3/T/Xq5y03kIIxA8LejejEGn6cVMZLJsJOXX/FDzDuXoAUN6MiUCW16ZwCbVhetOLyW9Bsif6/PwdSXYpaplxx8vA4Af7lyDObxC5SEtsokR7u/sx85OAWUa6HkP+zeUsIcxtaqWvCYdKl3Ck8q8jSu3rcYo38L2LyuSI9kGmpl6swtbtCi/iIQL0pMbz71We8spyw9zSeBsI2+g3dcwM1AG7s4tzeO6Ky7y4JOamom5zaP2+TzolQaF1u8YEJoVZLj8hyCy6qTeI+Y+0fTuzE3EYzLOa4QadQTmKG2eBnlXZuvDx/izI2YqAC4yeGONpvI6gYVU539d06O+jpEQwIg2COpmgKmO+wPMuB6OvVcWwp1CwvrTU+dhKtGBOYlCfJRBYt0UQIgFrrVEV4zWrY7+kCu1ffLrIQ0eUnLR6lCtAy1hGEYS1R+OBquu05KaY5Eg==;5:i7nDHaGsi09FDfn/7jwONvV/CyTtKjZlNpcXLA4rTIFwSln0JDDYP3vtOuQUcqkd1+0rDhZ3MYKXqBy+aI3LOaYmFykP67koGjmevyUF+ObmAt0aiLC/OcP2X21igyzgr4A+VxTknELv0pCEqec+bppJxX7lXVCXDEl4nVEJeJ4=;24:Yw15x/JFiQiTv+mBmip0MCm64ICvVo+JZgaiFiYYwM2zl1IfhKD8blwnYBAoIaTpcjFTpFXOdmwQYTNX2kQssJwC4WOakOcejHJyJIwmMsc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4377;7:B5hcKgoh0scuvWZ7R0g9E8GypB6XyZvMJfIdEUE2gzno4X2fdvUImxzjBDqxZgpnp+AwgSC+Rp9AjipG/yrfi0aVCF18zS+/gWoal9qG9ZOkQeMKOuEHhozJCOYX/823cPs/rDmTqIp4caEmUK+U/tVAnv4CL7IU0RS45jgH+fFkLhabPyrw3dhGpGl+iERRnvIl2ip168VUxxpT0bHrUGfE7EbJ8po6D495loZWtviss+EzYHqj/VraA5ySjmID X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2018 22:06:19.0554 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7684741-1b9a-4692-fc3a-08d5d30c392e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4377 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > Acked-by: Dmitry Torokhov > Signed-off-by: Andy Shevchenko > --- > drivers/input/keyboard/gpio_keys.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c > index 052e37675086..492a971b95b5 100644 > --- a/drivers/input/keyboard/gpio_keys.c > +++ b/drivers/input/keyboard/gpio_keys.c > @@ -196,7 +196,7 @@ static ssize_t gpio_keys_attr_show_helper(struct gpio_keys_drvdata *ddata, > ssize_t ret; > int i; > > - bits = kcalloc(BITS_TO_LONGS(n_events), sizeof(*bits), GFP_KERNEL); > + bits = bitmap_zalloc(n_events, GFP_KERNEL); > if (!bits) > return -ENOMEM; > > @@ -216,7 +216,7 @@ static ssize_t gpio_keys_attr_show_helper(struct gpio_keys_drvdata *ddata, > buf[ret++] = '\n'; > buf[ret] = '\0'; > > - kfree(bits); > + bitmap_free(bits); > > return ret; > } > @@ -240,7 +240,7 @@ static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata, > ssize_t error; > int i; > > - bits = kcalloc(BITS_TO_LONGS(n_events), sizeof(*bits), GFP_KERNEL); > + bits = bitmap_zalloc(n_events, GFP_KERNEL); > if (!bits) > return -ENOMEM; > > @@ -284,7 +284,7 @@ static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata, > mutex_unlock(&ddata->disable_lock); > > out: > - kfree(bits); > + bitmap_free(bits); > return error; > } > > -- > 2.17.1