Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3910250imm; Mon, 18 Jun 2018 06:14:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLkGhXkl1SGK3g26V/39J1y8yHsiYMj+0V/aF5xxvbWruA7zIT9E4OOBkOykWyN+My6Xet7 X-Received: by 2002:a63:b543:: with SMTP id u3-v6mr11084625pgo.365.1529327664459; Mon, 18 Jun 2018 06:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529327664; cv=none; d=google.com; s=arc-20160816; b=UUCOQWkjxNb2T3drcIY8Lwiv1Qrw6e7w+tV/YWMgczh/YZbPvlvWWHN31nYxhY73vx n68zeJs6Mk+3gq2VNlOA69QF5qBrBOJbyBE71uzNP9MmiqJ38L+z7LH2fppZ79+SjG9G SBc/z9SjUg0qxHFA5ckAVPCnrDByWLqBZFQl3BCSFq3GEjUoqVTa8C0oQw8eZfyMSmxK lzgAqnZQSDAvqj0pNE1D5MjT50mcZF2RPc2TAHfAvQztBNAo93/xUHtfBqJgOcBRVGIs GjQNJHM9/9hHimWsKtSBJGIXJo+lqGr2w27KrQnwj0tf085Kd5f/BRN9uJl0igEF7Boo pHxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=oBEApq0Zjna1OaW6mQpp0+q59SNZFk42kBlDUmgtvRE=; b=o+09t9oN4lz+L961aCI4/pL2ViQdADHfJBhqfbfte5ugZeSZpX0zcMYGYp2DWjFgfL bD4L4ZrNGw0r6wph+uM0YHi1d7FPg4CzT+on853oCAsalWGOrJ6LLIY20EGGI1DX7cai nSRi64UT1q5o+68efGiHsHMKyMUYKnubELjBQwofD84humi1bEWdSvWXMPlK6u7cq3Vg bRkYkB3EXyFJ9pW6nEXXlBJyTVzemsTGQcVtg7zLaZy2CY2RpHihQlSZuanIKaFHHvAv Y1eJ+RytAoXEzR23seGoOBb497wQQi5/rVuZ37pgG3YU6iUzrnR+ah/f2D8sLZ2IE3Yy T/Jg== 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 b65-v6si12663230pfj.2.2018.06.18.06.14.10; Mon, 18 Jun 2018 06:14:24 -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 S934297AbeFRNLX (ORCPT + 99 others); Mon, 18 Jun 2018 09:11:23 -0400 Received: from mga17.intel.com ([192.55.52.151]:20213 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933241AbeFRNKI (ORCPT ); Mon, 18 Jun 2018 09:10:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 06:10:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,239,1526367600"; d="scan'208";a="60120292" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 18 Jun 2018 06:10:03 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 95005519; Mon, 18 Jun 2018 16:10:04 +0300 (EEST) From: Andy Shevchenko To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Shaohua Li , linux-raid@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, Andrew Morton , Yury Norov , linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, Joe Perches Cc: Andy Shevchenko Subject: [PATCH v3 4/5] Input: gpio-keys - Switch to bitmap_zalloc() Date: Mon, 18 Jun 2018 16:10:02 +0300 Message-Id: <20180618131003.88110-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618131003.88110-1-andriy.shevchenko@linux.intel.com> References: <20180618131003.88110-1-andriy.shevchenko@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. 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