Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp792363imm; Fri, 15 Jun 2018 06:24:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmE5XDebz3j7unqMeuSgE+3uDim/0+bUT0qScQFoikP6hFa08h2Jmt7+s2NczfwchrSdTy X-Received: by 2002:a62:234a:: with SMTP id j71-v6mr1895845pfj.221.1529069064603; Fri, 15 Jun 2018 06:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529069064; cv=none; d=google.com; s=arc-20160816; b=cUtvGCY4C8fHbiLahu1BruJLGTk8EzVUzNBmMCHxvIfiNCEauUKJjnsPC0/tQyBfDq 2GBP1upBJHCcBRjPUaUSql70GibxyRbqqBd2stp4c9ZjkG7HUGFxR6oxQORHngQ13PjY jVsCJd4OFRfCqhIa7OXzvHXjxYBJgdAmKoOgDEtnpWI2bU/jnb+JqmepuF0kEHbAciuJ iQU2rBPoO+TVgP6IUaQegXkJjhHpuzDlTwZ0CJ4n58bSTqwEPrDwSiHODr6zwGQL4+ty 0acUtpLUglPjq+BQgHsTi6vcvAxeo5KUJELtyAnUyM50OfAu55xAUcAHPg+/CB2oeSsP cMYA== 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=wZkkwMlDbEptJwwSHTRfAp1Af9ObzMH+LvwzNYm/hB+RMCwGeq7aeAaJyH7RK/hNZc N5sMNTY/wpp43SQidpgAg1Wddr9CjupJaVzfd3a2Gmc/vgCyW3N6/A5EKG8ijFlPTAIe 958Nk4EgWyTl/7bJFd7tn8b16ZmhGZlRYObOXjjn8RR0ddqpgIsRKYtJ9hZiVuM1+FQn RpWwVhWfldBm46keDhSZsuJo9jvgKxG8MvCeEBSl8nLl/xnMPlSWHR8WmYZXjispGAFW 2NCmcPYYh7+PZlRBdlCcgMRxz76V5APVMW532S5HyhFuDRDRtX2lbv2SgsdxHFhYs6c+ xELA== 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 m189-v6si6494848pga.107.2018.06.15.06.24.09; Fri, 15 Jun 2018 06:24: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 S965665AbeFONUX (ORCPT + 99 others); Fri, 15 Jun 2018 09:20:23 -0400 Received: from mga12.intel.com ([192.55.52.136]:16380 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936144AbeFONUV (ORCPT ); Fri, 15 Jun 2018 09:20:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2018 06:20:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,227,1526367600"; d="scan'208";a="47355779" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 15 Jun 2018 06:20:17 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6FB1F477; Fri, 15 Jun 2018 16:20:18 +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 Cc: Andy Shevchenko Subject: [PATCH v2 4/5] Input: gpio-keys - Switch to bitmap_zalloc() Date: Fri, 15 Jun 2018 16:20:16 +0300 Message-Id: <20180615132017.23889-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615132017.23889-1-andriy.shevchenko@linux.intel.com> References: <20180615132017.23889-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